Page 1 of 1

{serendipity_hookPlugin hook="entries_footer"}

Posted: Sun Feb 15, 2009 1:51 pm
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

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Mon Feb 16, 2009 10:15 am
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

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 4:28 pm
by yellowled
Digging this up again: Is there any (preferably Smarty) way to check whether the hook actually gives something back?

YL

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 6:42 pm
by garvinhicking
Hi!

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

Regards,
Garvin

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 7:13 pm
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

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 7:43 pm
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.

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 9:11 pm
by yellowled
Silly me. That's working. Thanks.

YL

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 9:19 pm
by Don Chambers
Glad it worked. Exciting new template coming together?

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 10:43 pm
by yellowled
Don Chambers wrote:Exciting new template coming together?
More like boring, rather simple new template coming together. :lol:

YL

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Tue Oct 13, 2009 11:43 pm
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:

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Wed Oct 14, 2009 12:26 pm
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

Re: {serendipity_hookPlugin hook="entries_footer"}

Posted: Wed Oct 14, 2009 4:15 pm
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: