[TYPO3-dev] adding a javascript file so that it is merged with the other ones

Stephan Großberndt s.grossberndt at sidebysite.de
Wed Oct 1 16:45:04 CEST 2014


So why don't you add conditions in your code to call
$GLOBALS['TSFE']->getPageRenderer()->addJsFile($resolved);
only in those cases when you need it?

Am 26.09.2014 um 16:35 schrieb Ivano Luberti:
> Hi all, I'm writing an extension that renders FE pages and as part of it
> I'm writing a bit of javascript.
>
> I would like to add it only in pages where is needed and I would like to
> have it compressed together with the other javascript already compressed
> and merged by TYPO3.
>
> I can of course use typoscript includeJS but I should then include in
> every page where my plugin is installed.
>
> I have found the pageRendereHook but it adds a new link in a new file
>
> I have tried
>
> $GLOBALS['TSFE']->getPageRenderer()->addJsFile($resolved);
>
> but with same result.
>
> Any suggestion?
>
>
>
>
> -------- Messaggio originale --------
> Oggetto: 	link JS
> Data: 	Fri, 26 Sep 2014 16:06:36 +0200
> Mittente: 	Maria Marcella Greca <greca at archicoop.it>
> A: 	Ivano Luberti <luberti at archicoop.it>
>
>
>
> I due link trovati:
>
> https://github.com/JostBaron/typo3-nkhyphenation/blob/master/Classes/Hooks/PageRendererHook.php
>
>
>
> Ciao
> Marcella
>
>
>
>




More information about the TYPO3-dev mailing list