Posting HTML or PHP into an entry

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Guest

Posting HTML or PHP into an entry

Post by Guest »

Forgive me if I explain this poorly, my brain is off and it is past my bedtime...

I created some div elements in an entry and I was hoping I could use some PHP to keep track of it

Code: Select all

<? $var = 50 ?>
for example.

Also, when I add HTML like this...

Code: Select all

<div>
  <div 2>stuff in div2
  </div>
</div>
the html comes out like this:

Code: Select all

<div><br />
  <div 2>stuff in div2<br />
  </div><br />
</div>
...which throws off my divs (the line breaks do).

Basically, I am not familiar with a way to input HTML and PHP correctly so HTML does not receive any <BR> lines and PHP is parsed okay (simple PHP, nothing crazy).

I'm still new to S9Y, so it may be something obvious..in which case..go easy on me ;)

thanks! loving this engine so far :D
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post by falk »

You must deactivate the nl2br-Plugin.
Guest

Post by Guest »

Aaaah...that'll do it :)

I tried the <? and ?> tag for PHP and it didn't seem to work...suggestions?

thanks!
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post by falk »

PHP-Tags in Templates are not working. If you will make your templates dynamic you must learn the smarty-syntax. Have a look in the documentation at smarty.php.net.
Guest

Post by Guest »

I actually just started looking at smarty stuff (very cool stuff).

can I use smarty tags when posting an entry?

thanks for all the info Falk
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post by falk »

If you meen you write in the entrytext smartytags, then i must answer: no idea, i don't test it yet. But if it works, then don't do it. I think this is very unsecure. And i see no reason to do it. Write your functions and so on in the templates.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

There is a plugin, serendipity_event_smartymarkup, which you can use if you want to use smarty markup in your entries themselves.

Have fun,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply