Include Javascript in <head> Section

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Include Javascript in <head> Section

Post by tomgsd »

I'm building a module that has multiple templates, some of which use javascript in the section.  However, I'm not sure how to include these when my module is called.

I've seen how the Album module uses ContentPostRender() to replace the tag with a link to the static file.  The problem is that I may end up with 10-15 different .js files for the different templates which is too much to include when not all of them are necessary.

There's also the option of two module calls with different actions, one for the head and one for the body but I'm trying to keep things as simple as possible!

Is there a way to only add stuff to the based on the current module template?
Green Sheep Design Ltd. - www.greensheep.co.uk
Post Reply

Return to “Developers Discussion”