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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Requirements in Include load after Layout-Requirements


Go to End


1618 Views

Avatar
joern

Community Member, 28 Posts

18 February 2010 at 9:00pm

Edited: 18/02/2010 9:01pm

Hi,
I have a problem with my Requirements, which I describe briefly:
Because the includes/header.ss is always loaded, I want to embed here the "global" css and javascript files. e.g. The jQuery library.

In the layout/pagetype.ss I load the required javascript files for this pagetype, but files are loaded before the library is loaded.

<!-- loaded in Layout/pagetype.ss -->
<script type="text/javascript" src="http://local.ss/themes/mysite/js/pagetype.js?m=1266431425"></script>

<!-- loaded in includes/header.ss -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://local.ss/themes/mysite/js/global.js?m=1266420678"></script>

In what order the files are gone through?

I'm using the 2.4-beta…

Thanks and greetings
Jörn