Page 1 of 1

bulletproof html question

Posted: Mon Dec 10, 2007 8:28 am
by www.itstillstands.com
How do you place an html entry automatically at the bottom of every new entry. is this a plugin i dont see? thanks for any help. Love the serendipity blog so far!

www.itstillstands.com

Re: bulletproof html question

Posted: Mon Dec 10, 2007 8:36 am
by yellowled
www.itstillstands.com wrote:How do you place an html entry automatically at the bottom of every new entry.
I'm sorry, but I have absolutely no idea what you could possibly mean by "an html entry" ..?

YL

Posted: Mon Dec 10, 2007 6:34 pm
by www.itstillstands.com
oops, sorry. what i mean is a section at the bottom of each entry that you could put some code or a message in every time automatically, like a signature on a forum. Hope this helps, thanks for any assistance.

Posted: Mon Dec 10, 2007 8:50 pm
by judebert
The easiest way is to modify your entries.tpl file. Its location depends on the template you're using. If it's not in the directory for your template, Serendipity will use the one in the templates/default directory instead.

This is a mostly-HTML that's used to output each entry. The part that's not actually HTML is Smarty, a templating language that lets you do a lot more than plain HTML.

Just insert your HTML wherever you'd like it to go.

One place you might like to place it is here:

Code: Select all

            <div class="serendipity_entry_body">
                {$entry.body}
            </div>

            {if $entry.is_extended}
            <div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
            {/if}
The first <div> is the entry body; the second <div> is the extended body. The non-HTML stuff is examining or printing out Serendipity data (the entry body and the entry extended body, as if you couldn't tell).

You might also want your signature in the footer; just a few lines down, you'll find:

Code: Select all

             <div class='serendipity_entryFooter'>
That's the start of the footer. This includes the "posted by", "in" categories, and "at" date fields. Add your signature anywhere you like.

Posted: Tue Dec 11, 2007 12:04 am
by www.itstillstands.com
Thanks so much, I'll give it a try

Posted: Wed Dec 12, 2007 5:51 am
by Don Chambers
I think I suggested this exact functionality my fellow bp teammates.... but before they could even respond, I realized a serious problem... if EVERY entry is going to get this additional footer, or "signature", how do we elect NOT to include this info for specific entries where it might not apply?

For this reason, I honestly think this functionality should be a plugin, with the ability to disable it on a per-entry basis... much like some of the markup plugins can be disabled for a specific entry.

Posted: Wed Dec 12, 2007 10:50 am
by garvinhicking
Hi guys!

Have you checked into the "include entry/blocks" plugin? This can attach HTML blocks to entries, also generically to ever Xth entry of a page.

Regards,
Garvin

Posted: Wed Dec 12, 2007 4:51 pm
by judebert
I actually use the entry blocks plugin for the table of contents on the EV conversion category of my blog. (I'm considering writing a next/prev plugin to replace that functionality, though.)

It would certainly work for this application. However, if you try to add a block every 1 entry, doesn't it put the block between entries? From the description, I thought he wanted something in the entry, and editing the entries.tpl gives the user the finest control.

If multiple signatures are required, then the entry block plugin is highly recommended again. Just use [s9y-include-block:#] to put the signature with the given number into the entry.