[TYPO3] Noobie - Javascript Including, Setup Screens

Rens Admiraal typo3 at ambitiondesign.nl
Tue Jun 19 14:48:12 CEST 2007


Hi Sancar,

I'm relatively new to Typo also, but I can give you an answer for  
your second question :-)

You can add javascript code to the header using the $GLOBALS['TSFE']- 
 >additinalHeaderData array:

$GLOBALS['TSFE']->additionalHeaderData[] = file_get_contents 
(t3lib_extMgm::extPath($this->extKey, 'pi1/script.js'));

(this reads the content from the file pi1/script.js in the frontend  
extension dir, and puts it in the header. Don't forget to add the  
<script> tags in this js file


Greetz,
Rens






Op 19-jun-2007, om 14:33 heeft Sancar Saran het volgende geschreven:

> Thanks for reply. Last 2 weeks I'm carving the typo3 docs. My  
> english was
> limited and most documentation was not helpful.
>
> And here my questions
>
> 1-) How can I generate setup screens for extensions. (or is there  
> any ability
> for this)
>
> My extensions has several user filled options (for example info e-mail
> address, form post page, price limit  etc etc).
>
> Is there any way to do this.
>
> 2-) How can I insert Javascript reference in to page <head></head> by
> default ?
>
> In documents I see some typoscript examples to add some external  
> javascripts.
>
> My problem was, I want to add this external javascripts in to   
> header by
> default. When site admin adds my extension into page content this  
> javascripts
> have to included by default.
>
> 3-) I had several utlity functions. I want use these functions in my
> extensions. Where is the best location to put this functions.
>
> Thanks for help
>
> Regards
>
> Sancar
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list