what about:
- making a new template names 'javascript' that contains only
Create a new content page, connect the 'javascript' template, hide it from menu, disable wysiwyg editor for the page.
Type your JS in content area.
Then, in template where you want to include JS:
Code: Select all
<__script__ type="text/javascript" src="{cms_selflink href='alias-of-page'}"></__script>
where 'alias-of-page' must be changed of course.
Quick test shows me it works.
Caveats:
- you might want to prevent normal editors to be able to edit those pages
- the content type that the webserver sends could be 'text/html' which actually is not right. You should test this on multiple browsers. Or maybe there is a way to change that behaviour via some php/UDT in the template.