Page 1 of 1

Posting HTML or PHP into an entry

Posted: Wed Nov 16, 2005 5:28 am
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

Posted: Wed Nov 16, 2005 8:28 am
by falk
You must deactivate the nl2br-Plugin.

Posted: Wed Nov 16, 2005 2:20 pm
by Guest
Aaaah...that'll do it :)

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

thanks!

Posted: Wed Nov 16, 2005 2:44 pm
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.

Posted: Wed Nov 16, 2005 3:01 pm
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

Posted: Wed Nov 16, 2005 3:10 pm
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.

Posted: Thu Nov 17, 2005 1:17 pm
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