[TYPO3-mvc] Bug 5385 : getPageRenderer() fails with uncached action

Thomas Allmer at at delusionworld.com
Tue Apr 3 00:11:47 CEST 2012


On 25.05.2010 11:39, Xavier Perseguers wrote:
> Hi,
>
>> I just stumble across bug 5385 [1] which found that basically says that
>> using
>>
>> $GLOBALS['TSFE']->getPageRenderer()-> variousMethods
>>
>> does not work for uncached actions.
>>
>> For instance. Adding CSS or JS only works when using a cached action.
>> Does someone already have a working solution for that?
>
> Well, as I'm still a bit asleep :-/ It cannot work as it is incompatible
> with how TYPO3 handles non-cached content.
>
> As you know, non-cached content is stored as a special marker in the
> whole (cached) page. And this marker is replaced by the USER_INT content
> when the page is requested. As such, there is no way to use pageRenderer
> to add further information to the page header...
>
> However the trick is to use
>
> $this->response->addAdditionalHeaderData('
> <script type="text/javascript" src="/path/to/your/script.js"></script>');
>
> The same for CSS, ...

I thank you for answering you own question :)
You saved my brain - I was about to go crazy :p

cheers
-- 
+---------------------------------+-----------------------------------+
| Thomas Allmer                   |   http://www.delusionworld.com    |
| E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
+---------------------------------+-----------------------------------+


More information about the TYPO3-project-typo3v4mvc mailing list