[TYPO3] add css and javascript to new extension
Jeroen Visser
jeroen at roquin.nl
Sun Dec 30 23:08:15 CET 2007
Hi,
The CSS works by adding it to the file setup.txt in static/css/ directory. Now I hoped to do the same for
the javascript that is needed. So I made a file static/js/setup.txt
In this file I added the following code (which works when adding it to my setup.):
plugin.my_new_ext {
page.headerData.50 = TEXT
page.headerData.50.value (
<script src="typo3conf/ext/my_new_ext/static/js/myscript.js" type="text/javascript"></script>
)
}
Unfortunately this does not work. By the way, when the variable "page" is called differently it will not work either.
Does anyone know how to implement a javascript when installing a new extension or by adding it with "Include static..." function?
Any help appreciated.
Kind regards,
Jeroen
Tapio Markula wrote:
> Jeroen Visser kirjoitti:
>> Hi all,
>> Can anyone tell me how to add a javascript file to a new written
>> extension?
> > I thought to make it available in the "Include static (from
>> extensions)"
>> field but that does not seem to work.
>
> should work - but If used linked CSS maybe the path was incorrect
>
>
More information about the TYPO3-english
mailing list