Static pages plugin uses entries.tpl? WTF?

Creating and modifying plugins.
Post Reply
User avatar
yellowled
Regular
Posts: 7083
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Static pages plugin uses entries.tpl? WTF?

Post by yellowled » Thu Oct 15, 2009 3:35 pm

Okay, so in case you were wondering why I asked about all this {serendipity_hookPlugin hook="entries_footer"} stuff in the first place, here's the reason why.

I'm working on a new template for my blog. My entries.tpl uses the pagination code Jude and I developed some time ago. This is only used in the entries.tpl, yet I get an empty <div class="pagination"></div> on static pages!

How's that possible? And is there a way to get rid of it? (.pagination is styled in this template, so the empty div is not only unnecessary but also noticable on screen)

(Yes, I know how to suppress it using CSS/display: none; -- but I'd much rather weed it out completely.)

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Static pages plugin uses entries.tpl? WTF?

Post by Don Chambers » Thu Oct 15, 2009 4:26 pm

Instead of display:none, how about wrapping your entire entries.tpl in this:

Code: Select all

{if $staticpage_pagetitle ==''} {* proceed only if this is not a static page *}
    .....
{/if}

User avatar
yellowled
Regular
Posts: 7083
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Static pages plugin uses entries.tpl? WTF?

Post by yellowled » Thu Oct 15, 2009 4:34 pm

Don Chambers wrote:

Code: Select all

{if $staticpage_pagetitle ==''} {* proceed only if this is not a static page *}
    .....
{/if}

See, this is the kind of stuff I never stumble upon on my own. Kind of like I'm wearing blinders or something. Jeez.

Tested ... aaand it works. Thanks.

(I'd still like to know the why here, though.)

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Static pages plugin uses entries.tpl? WTF?

Post by Don Chambers » Thu Oct 15, 2009 4:38 pm

Yeah, I stumbled on this same issue with Kinetic... sometimes I think Garvin planted little bumps in the code here and there just to see if we could find them! :lol:

I too would like to know why entries.tpl is called at all for static pages, since it has its own smarty templates. Would not be surprised to learn that is some kind of leftover to when static pages were first developed.

User avatar
yellowled
Regular
Posts: 7083
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Static pages plugin uses entries.tpl? WTF?

Post by yellowled » Thu Oct 15, 2009 4:40 pm

Don Chambers wrote:Yeah, I stumbled on this same issue with Kinetic... sometimes I think Garvin planted little bumps in the code here and there just to see if we could find them! :lol:

Not bumps. Hooks. At least that's what I'd put my money on. :)

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

Post Reply