coments

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
chasy
Regular
Posts: 31
Joined: Sat Jan 27, 2007 4:19 pm
Contact:

coments

Post by chasy »

Hi can i put coments in top of my artickle?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Yes, but it'll take a little bit of HTML knowledge to do it.

Serendipity uses a template engine called Smarty to output all its data. Smarty uses standard HTML, but adds {} tags to do extra stuff, like looping and printing variables.

The entries and their comments are printed from entries.tpl. Normally this is in your current template's directory, something like templates/brownpaper/. If it's not there, Serendipity will fall back to the templates/default/ directory instead. I recommend copying the default/entries.tpl to your template directory before editing it, so the original version won't be spoiled.

SO, edit your entries.tpl. Find the line that looks like {serendipity_printComments blah blah blah}. Along the way, you'll notice lots of {if} statements and HTML. That's how Smarty and Serendipity choose the correct way to print your entries. For instance, if it's not a single entry (for instance, we're looking at all the entries in a category), then we don't print the comments out.

Go back up until you find the spot where your entry is printed. Insert the serendipity_printComments line here. Save the file, reload your page, and you should see your comments in their new location.
Judebert
---
Website | Wishlist | PayPal
chasy
Regular
Posts: 31
Joined: Sat Jan 27, 2007 4:19 pm
Contact:

coments

Post by chasy »

Thank you it works well.
Post Reply