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

Chris chris at oblady.com
Tue Jun 17 17:16:49 CEST 2008


I don't understand... I never use strings but numbers, here is a real 
example of one of my sites :

page = PAGE
page.typeNum = 0
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page

page.includeCSS.1=fileadmin/templates/css/broker.css
[browser=msie]
page.includeCSS.2=fileadmin/templates/css/ie.css
[browser=msie6]
page.includeCSS.3=fileadmin/templates/css/ie6.css
[end]
page.includeCSS.10=fileadmin/templates/css/print.css
page.includeCSS.10.media=print

Believe me or not, it works for me  :-)


Esben Maaløe a écrit :
> If I do that - nothing gets included!
> 
> On Tue, Jun 17, 2008 at 1:24 PM, Chris <chris at oblady.com> wrote:
>> Hello,
>>
>> what I usually do is this :
>>
>> page  {
>>  includeCSS.1 = ...
>>  includeCSS.2 = ...
>>  includeJS.1 = ...
>>  includeJS.2 = ...
>> }
>>
>> this way the order is kept, as far I know.
>>
>> I often use this myself to include specific files for IE6, like this :
>>
>> page.includeCSS.1 = myMainCSS
>> [browser=msie6]
>> page.includeCSS.2 = IE6SpecificCSS
>> [end]
>>
>> this way in my IE6 css I don't have to rewrite all the stuff, just the fixes
>>
>> regards,
>>
>> Chris
>> www.oblady.com
>>
>> Esben Maaløe a écrit :
>>> 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
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>>


More information about the TYPO3-english mailing list