{serendipity_hookPlugin hook="entries_footer"}

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

{serendipity_hookPlugin hook="entries_footer"}

Post by yellowled »

I'm just wondering if {serendipity_hookPlugin hook="entries_footer"} will ever produce any actual output in entries_archives.tpl or entries_summary.tpl.

Doesn't seem like it as far as I have seen - why are these in there anyway? :)

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by garvinhicking »

Hi!

I have coded custom templates with specific plugins that use this hook on pages like these. Other people might have as well; just because spartaucs s9y plugins don'T use it, mustn't mean that other installations don't have custom plugins that specifically output stuff on these pages. :)

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

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by yellowled »

Digging this up again: Is there any (preferably Smarty) way to check whether the hook actually gives something back?

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by garvinhicking »

Hi!

You could maybe use {capture} around the hook execution and check if the output is != ''...?!

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

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by yellowled »

Weird.

If I, i.e. use this in the entries.tpl:

Code: Select all

{capture name="foo"}
    {serendipity_hookPlugin hook="entries_footer"}
{/capture}

{if $smarty.capture.foo != ''}
    {* my conditional smarty code *}
{/if}
it still emits "my conditional smarty code" even if $smarty.capture.foo is empty ... am I using this the wrong way?

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by Don Chambers »

Try this:

Code: Select all

{capture assign='foo'}
    {serendipity_hookPlugin hook="entries_footer"}
{/capture}

{if $foo !=''}
    ....
{/if}
It is also possible that {if $foo} will evalutate to true if it is not blank... didn't test it.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by yellowled »

Silly me. That's working. Thanks.

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by Don Chambers »

Glad it worked. Exciting new template coming together?
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by yellowled »

Don Chambers wrote:Exciting new template coming together?
More like boring, rather simple new template coming together. :lol:

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by Don Chambers »

yellowled wrote:More like boring, rather simple new template coming together. :lol:
Well, it is better than sitting around doing nothing! :wink:
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by yellowled »

yellowled wrote:That's working.
Actually, no, it's not. Still does not emit the hook results, even if there are any.

But never mind, I found another solution for this particular project.

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: {serendipity_hookPlugin hook="entries_footer"}

Post by Don Chambers »

yellowled wrote:Actually, no, it's not. Still does not emit the hook results, even if there are any.
Its not going to emit the results, unless you emit them because the results were captured and assigned to {$foo}.

So, if you want the results displayed together with some other conditional thing, you should do:

Code: Select all

{capture assign='foo'}
    {serendipity_hookPlugin hook="entries_footer"}
{/capture}

{if $foo !=''}
    <p>{$foo}</p> {* if you need it as its own element *}
    {* your conditional smarty code *}
{/if}
... at least, I think that should work. :wink:
=Don=
Post Reply