customhead.tpl in plugin/templates

Customhead.tpl in plugin/templates, a forum discussion on Jojo CMS. Join us for more discussions on Customhead.tpl in plugin/templates on our General Discussion forum.

Back to Forum Index : Back to General Discussion   RSS
synfield

1 Jan 2010
Posts: 43

I've read the number of ways javascript can be included in the header/footer etc.

I'm wanting to have javascript block available to only a specific plugin and so far $content['javascript'] = $smarty->fetch('jojo_contact_js.tpl'); is the only way I can do this.

I tried using customhead.tpl in plugin/templates but this gets 'globally' loaded across the site, I would've thought that the purpose was to make this javascript local to the plugin, as creating customhead.tpl under themes/templates already makes this available site wide?

Harvey

Core Developer

Harvey

4 Jan 2010
Posts: 327

Hmm, I thought the above code did make the script local to the plugin, but there may be a valid reason why this isn't the case (eg plugins that operate across the whole site rather than being bound to a page). I may need to look into this further.

Here's another thing you can try...

Look on the 'Technical' tab of 'Edit Pages' for the 'Head content' field. You can insert any js / css etc here, and these will appear only or this specific page.

This will only work for static scripts - I don't think it will work for generated scripts.
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.