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

Susanne Moog typo3 at susanne-moog.de
Thu Nov 12 14:47:48 CET 2009


Hey,

Steffen Kamper wrote:
> Hi,
> 
> use same syntax in TS as in your extension. Which is taken first depends
> on your setup, i think TS is done first mostly.

which setup? my TS is always taken last it seems.

> 
> At the end all are in same array(s). CSS also have 'forceOnTop' you
> should use for the common stuff.

Yes, but it does not seem to work with stuff from extensions and from
TS. This is my conf:

$GLOBALS['TSFE']->getPageRenderer()->addCssFile('typo3conf/ext/....css');

and in TS

page.includeCSS.file1 = fileadmin/css/reset.css
page.includeCSS.file1.forceOnTop = 1

Output is first typo3conf/ext... then fileadmin/css/reset.css

If I debug the $this->cssFiles array in the pagerenderer it shows that
forceOnTop is set correctly but has no effect on the order at all.


> 
> If you can't achieve it that way you could use the concatenateHandler to
> sort the array for your need. Maybe we need a renderHook as well.

I'll have a look into it later.

Perhaps we could have an additional key, string, whatever, to sort by,
so that I could define, ok, reset is "a", extension is "b", common.css
is "c" and so on...

Thanks for answering :)

Susanne


More information about the TYPO3-project-4-3 mailing list