[TYPO3-english] Disable caching of a plugin

Erik Svendsen erik at linnearad.no
Mon Apr 19 22:13:39 CEST 2010


Den 19.04.2010 16:27, skrev Simon Strandgaard:
> On Mon, Apr 19, 2010 at 4:09 PM, Ries van Twisk<typo3 at rvt.dds.nl>  wrote:
>
>>
>>> /*
>>> in main()
>>> */
>>> $this->pi_USER_INT_obj = 1;  // Disable caching
>>> $GLOBALS["TSFE"]->set_no_cache();
>>>
>>
>>
>> It's currently strongly discouraged to use set_no_cache()
>> and in fact the behavior can be turned off completely within the install
>> tool.
>>
>> Best way to add the JS/CSS is using typoscript.
>
>
>
> Ok.
>
>
> I have been looking through a lot of extensions to see how
> to add a javascript include via typoscript, but without luck.
>
> I guess ext_localconf.php should contain something like this..
> t3lib_extMgm::addTypoScript($_EXTKEY, 'magic... res/misc.js ... magic');
>
> Any hints how misc.js can be included?
>
>
>

There are lot of extensions which includes javascript in some form. Look 
at extensions like rggooglemap, which includes javascript only when 
extensions is loaded.

You may also include javascript through HTML-template for the extension. 
It's done partly this way in some of the commerce extension.

One easy example in plugin typoscript - for javascript inclusion in header.

page.headerData.996 = TEXT
page.headerData.996.value = <script language='javascript' // 
src='typo3conf/ext/myext/res/my.js'></script>

Regards

Erik Svendsen.



More information about the TYPO3-english mailing list