[TYPO3-mvc] CSS and JS files get included in the wrong order if using the page-renderer

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Mon Nov 9 19:22:27 CET 2009


Hello!

I'm including JS and CSS files using 
$GLOBALS['TSFE']->getPageRenderer()->addJsFile($file); inside a 
user-function.

For my surprise the order of the files in the source is the following:

<head>
     <!-- $file is put at the top: -->
     <script src="$file" type="text/javascript"></script>

     <script src="reset.js" type="text/javascript"></script>
     <script src="common.js" type="text/javascript"></script>
</head>

The files 'reset.js' and 'common.js' were defined inside the
TYPO3 page object using typoscript.

Imho the files defined in the page object should be renderer
BEFORE all other includes done by the API inside hooks etc.

Since I don't know how the page object is called in the typoscript,
I can't add my extension JS-files using typoscript.

Is there any other solution to get a correct source-order for this?

Thanks a lot!

PS: Sorry for double post, but I think this fits here more,
as I got no answers in "typo3_4-3.general" until now.


More information about the TYPO3-project-typo3v4mvc mailing list