[TYPO3] includeJS and includeCSS including files in the wrong order!

Esben Maaløe acebone at gmail.com
Tue Jun 17 12:34:15 CEST 2008


Hi!

In the following script i include some JavaScript and some CSS on ALL
pages. One specific page needs some additional JS and CSS. I check for
the PID and include the extra files if the PID is that of my special
page.

However - the order of the includes are reversed, the special page
includes it's special files FIRST and then the general files. That's
not good because I want the generic JS and CSS first and then
modify/add to it.

How can I control the order of includes?

Example:

This TS:

#===============================================================================
# Setting up the page
#===============================================================================

page = PAGE
page.typeNum = 0

page.includeJS {
    extbase = fileadmin/CONFIG/lib/js/extjs/adapter/ext/ext-base.js
    extall =  fileadmin/CONFIG/lib/js/extjs/ext-all-debug.js
    kickoff = fileadmin/CONFIG/ROOT/template/web/js/kickoff.js
}

page.includeCSS{
    css_all = fileadmin/CONFIG/ROOT/template/web/css/web.css
}


#===============================================================================
#  Page Specific TS
#===============================================================================
[PIDinRootline=9]
    page.includeJS {
        pageid_register = fileadmin/CONFIG/ROOT/template/web/js/register.js
    }

    page.includeCSS {
        pageid_register = fileadmin/CONFIG/ROOT/template/web/css/register.css
    }
[end]

Produces this output:

<link href="typo3temp/stylesheet_b6ca16faeb.css" type="text/css"
rel="stylesheet" />
<link href="fileadmin/CONFIG/ROOT/template/web/css/register.css"
type="text/css" rel="stylesheet" /> <!-- NOT GOOD - I WANT THIS TO BE
THE LAST CSS FILE! -->
<link href="fileadmin/CONFIG/ROOT/template/web/css/web.css"
type="text/css" rel="stylesheet" />
<script type="text/javascript"
src="fileadmin/CONFIG/ROOT/template/web/js/register.js"></script><!--
NOT GOOD - I WANT THIS TO BE THE LAST JS FILE! -->
<script type="text/javascript"
src="fileadmin/CONFIG/lib/js/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript"
src="fileadmin/CONFIG/lib/js/extjs/ext-all-debug.js"></script>
<script type="text/javascript"
src="fileadmin/CONFIG/ROOT/template/web/js/kickoff.js"></script>

TIA for any answers

Regards Esben


More information about the TYPO3-english mailing list