[TYPO3-english] getPageRenderer()->addJsFile() always adds CSS files on top

Markus Klein klein.t3 at mfc-linz.at
Sat Oct 5 17:12:17 CEST 2013


Hi!

I've a simple website with three CSS files added in TS.

page.includeCSS.file1 = ...
page.includeCSS.file2 = ...
page.includeCSS.file3 = ...

My extbase controller (cached) adds a CSS file via

/** @var PageRenderer $pageRenderer */
$pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
$pageRenderer->addCssFile($path . 'Resources/Public/Css/thestyles.css');

Unfortunately the final HTML output has the CSS file added by the plugin listed first.

<link ... thestyles.css
<link ... [file1]
<link ... [file2]
<link ... [file3]

The extension CSS should be placed last.
(For placing it on top there's the option "forceOnTop")

Any ideas what to do?
(besides rendering my own link tag via additionalHeaderData())

Thx.

Kind regards
Markus

------------------------------------------------------------
Markus Klein
TYPO3 CMS Active Contributors Team Member





More information about the TYPO3-english mailing list