[TYPO3-dev] JavaScript and USER_INT plugins

Krystian Szymukowicz t33k at prolabium.com
Tue Mar 29 13:40:48 CEST 2011


W dniu 2011-03-29 13:26, François Suter pisze:
> Hi Krystian,
>
>> This way the main() is called twice. Once to get cached content and the
>> second time when TYPO3 gets the USER_INT parts.
>
> I'm not sure I understand that. How come is main() called twice?
>

If I understand well this is how TYPO3 generates page - first call:

1. If the plugin is USER then TYPO3 calls main() and gets the content of 
it and adds it to cached version of the page (cache_pages)

2. If the plugin is USER_INT then TYPO3 puts only special marker in the 
cached of the of the page (html source).

3. Then if the "cached" version exist TYPO3 now will call main() of the 
USER_INT plugins.

Any call other than "first call" will only take step 3 (so most of the 
page is taken from cache and only USER_INT are called)



Now.

Our special plugin is at the beginning regular USER so TYPO3 calls our 
main(). In this function we return content that will be added to cached 
version of the page but additionally we inform TYPO3 by 
$this->cObj->convertToUserIntObject(); that we want to be called also as 
regular USER_INT (so with each page refresh).

-- 
grtz
Krystian Szymukowicz




More information about the TYPO3-dev mailing list