Entry Date div not being generated

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
sonichouse
Regular
Posts: 196
Joined: Sun May 11, 2008 2:53 am
Contact:

Entry Date div not being generated

Post by sonichouse »

When going to pages two onwards the second entry does not have

Code: Select all

<div class="hentry serendipity_Entry_Date">
I have based my theme on buletproof, but I cannot work out why this is happening.

This can be seen here.
Steve is occasionally blogging here
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Entry Date div not being generated

Post by garvinhicking »

Hi!

Actually, this is intentional. The date for entries that are posted on the same day are only emitted once in default s9y themes.

If you want that date for each entry, even resulting in duplicate dates, you must shuffle the {foreach} loops inside the entries.tpl file around. Once you look at that loop, you should immediately see why the date is only showed once, because the <div> is outputted inside the outer loop, not the inner loop.

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 »

So, by "shuffle the {foreach} loops", Garvin means to move the <div> containing the date from the outer loop to an appropriate location in the inner loop.

And by "appropriate location", I mean the spot you want the date to appear in the HTML. When looking at Smarty, you see almost the HTML displayed for one entry; the extra {foreach} and other Smarty tags simply cause things to be duplicated for extra entries, with the right data substituted (like name, contents, date, and so on).

If you have any specific questions on the Smarty, we'll be here to help.
Judebert
---
Website | Wishlist | PayPal
sonichouse
Regular
Posts: 196
Joined: Sun May 11, 2008 2:53 am
Contact:

Post by sonichouse »

Thanks guys for the explanation - all is clear now :lol:

I was adding the push-pin to the date - not the title.

Moving the graphic to the title has resolved my issue.

Cheers.
Steve is occasionally blogging here
Post Reply