Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

JavaScript adding to themplete

Go to End

2 Posts   1271 Views


Community Member, 2 Posts

7 January 2012 at 3:23am


so, i have this:

<script type="text/javascript" src=""></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/jquery.easing.compatibility.js"></script>
<script type="text/javascript" src="js/coda-slider.1.1.1.js"></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/start.js"></script>
<script type="text/javascript">;</script>

and i need to add it to
should it look like this:
<% static void javascript( %>
<% static void javascript(;) %>

thanks for the reply, coz i cant understand from the manual how to do this.



Forum Moderator, 5523 Posts

7 January 2012 at 9:03pm


For the final line you can just keep it as a script tag.

If you're including all those files, perhaps you want to minify and combine the files. This time in your PHP Page.php init function (has to be via the Requirements PHP API as the template one doesn't support the syntax in 2.*)

Requirements::combine_files("main.js", array(