Hey family,
I'm having trouble getting some javascript to run in one of my templates. If I add the following to the top of my HomePage.ss template, the associated Javascript is called in the head of the rendered page but the slideshow fails to work:
<% require javascript(mysite/javascript/fadeslideshow.js) %>
However if I add it to the head section of the Page.ss template, it works fine.
I also have the following in my Page.ss template:
<% require javascript(http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js) %>
On checking the source code of the rendered pages, I see that the slideshow works when fadeslideshow.js is positioned after the jquery.min.js, but fails when it is positioned before it.
So, how can I force Silverstripe to position the script in HomePage.ss before the script in Page.ss?