Re: smarty custom function jojoHook

Re: smarty custom function jojoHook , a forum discussion on Jojo CMS. Join us for more discussions on Re: smarty custom function jojoHook on our General Discussion forum.

Back to Forum Index : Back to General Discussion   RSS
synfield

25 Jul 2008
Posts: 43

I'm curious to know what {jojoHook hook="productBeforeBody"} and {jojoHook hook="productAfterBody"} means - these are found in the articles plugin template.

I've had a cursory look at the runSmartyHook function in the main JOJO class, which to me loads & runs a function from a plugin class.

But I've done a global find in the site directory and no function seems to be defined for this.

Would appreciate some insight into how this works.
Thanks.
Harvey

Core Developer

Harvey

25 Jul 2008
Posts: 327

You mean {jojoHook hook="articleBeforeBody"} right?

These hooks are for allowing other plugins to add content to the template.

For a practical example of how this works, have a look at the jojo_blogicons plugin - which inserts a row of Digg, Technorati, Furl etc icons using the articleAfterBody hook.
synfield

28 Jul 2008
Posts: 43

Does this function e.g. articleBeforeBody, get loaded into the $_hooks global array at runtime or at setup.

I tried to print_r this variable in the runSmartyHook function in the main JOJO class but this doesn't print to screen when accessing a template with {jojoHook hook="articleBeforeBody"} .

So how then does the runSmartyHook function find the class, that the function articleBeforeBody belongs i.e. where does the global var $_hook get populated, in order to find the class name $classname = 'JOJO_Plugin_' . $hook[0];

Regards.
Back to Forum Index : Back to General Discussion   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.