[TYPO3-dev] JavaScript and USER_INT plugins
Krystian Szymukowicz
t33k at prolabium.com
Tue Mar 29 13:03:04 CEST 2011
W dniu 2011-03-29 12:28, François Suter pisze:
> Hi all,
>
> I can't remember what the situation is about the issue of not being able
> to load JavaScript files from inside a USER_INT plugin, when the rest of
> the page is already cached. I know there was a lot of discussion but
> were there results? Workarounds?
>
> Cheers
>
I do somthing like that:
function main($content, $conf) {
if ($this->cObj->getUserObjectType() == tslib_cObj::OBJECTTYPE_USER) {
// add you css and js the standard way - it will be cached
$pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
$pageRenderer->addJsFile($clientPublicFolder .
'JavaScript/plupload.full.min.js');
// early return
return;
}
// later part that returns real content
....
}
This way the main() is called twice. Once to get cached content and the
second time when TYPO3 gets the USER_INT parts.
--
grtz
Krystian Szymukowicz
More information about the TYPO3-dev
mailing list