bulletproof html question

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
www.itstillstands.com
Regular
Posts: 7
Joined: Sun Dec 09, 2007 11:05 pm
Contact:

bulletproof html question

Post 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
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: bulletproof html question

Post 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
www.itstillstands.com
Regular
Posts: 7
Joined: Sun Dec 09, 2007 11:05 pm
Contact:

Post 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.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
www.itstillstands.com
Regular
Posts: 7
Joined: Sun Dec 09, 2007 11:05 pm
Contact:

Post by www.itstillstands.com »

Thanks so much, I'll give it a try
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
Post Reply