[TYPO3-dev] Best practice for including JS / CSS from an extension

Pierre Dudoret p.dudoret at groupe-belink.fr
Tue Jun 14 12:48:51 CEST 2011


Hi,

2011/6/14 Fabien Udriot <fudriot at omic.ch>Conclusion:
>
> Unless there are other techniques, the best approach I see so far, is to
> have two Static TypoScript files:
>
> - EXT:foo/Configuration/TypoScript/setup.txt -> contains global
> configuration, loaded on root page
> - EXT:foo/Configuration/TypoScript/header.txt -> HTML header inclusion,
> loaded on the same page of the extension.
>

There's of course other techniques, but IMO the best solution is your 3rd
(viewhelper in template), as your html template and your javascript code are
strongly linked. The good part of your 3rd solution (wich I used since years
in fact) is that if you want another layout or behaviour, you just have to
change your template (and no typoscript or php code to override)

I use that kind of solutions since a few years throught my own library, and
it works very well.

Regards,
Popy




More information about the TYPO3-dev mailing list