[TYPO3-performance] Typoscript with conditions or ext template on page

Georg Kuehnberger georg at georg.org
Fri Dec 18 17:23:45 CET 2009


Sven Wolfermann wrote:
> Am 15.12.2009 15:55, schrieb Michiel Roos [netcreators]:
>> Op 12/15/09 1:42 PM, Martin Kutschker schreef:
>>> Mathias Schreiber [wmdb>] schrieb:
>>>> Sven Wolfermann schrieb:
>>>
>>>>> sample constants condition:
>>>>>
>>>>> [PIDinRootline = 703]
>>>>> homeID = 703
>>>>> catId = 1,6,18
>>>>> showListId = 946
>>>>> showEventId = 945
>>>>> newsSingle = 3343
>>>>> newsFolder = 353,248,53
>>>>> plugin.tx_cal_controller.pidList = 2476,1457,1954
>>>>> [end]
>>>>
>>>> Ext Templates are faster, since conditions are parsed (uncached) at any
>>>> page request.
>>>>
>>>> Drawback:
>>>> A lot of things are only possible with conditions AND ext Templates are
>>>> a bit more "chaotic" to find.
>>>> Basically I like to keep my stuff at one place only.
>>>
>>> A matter of taste. I don't like PIDinRootline at all. PIDs mean 
>>> nothing to me (without a further
>>> comment in the TS) when I try to understand the TS code. So I prefer 
>>> ext templates for branches.
>>>
>>> Masi
>>
>> We use constants instead of PIDs.
>>
>> On the template in the site root we have the constants:
>>
>> newsPage       = 1
>> newsSinglePage = 2
>> someOtherPage  = 3
>>
>> And then in the ext templates we use those constants in the conditions.
>>
>> We don't like spreading templates across the whole tree.
>>
> But that is the way we do this.
> We have conditions in our constants template on root page.
> -----------
> 
> homeID = 1
> catId = 1,2,3
> showListId = 4
> showEventId = 5
> 
> #now there is another constants set for the PIDinRootline 703 in the 
> following lines:
> 
> [PIDinRootline = 703]
> homeID = 703
> catId = 1,6,18
> showListId = 946
> showEventId = 945
> [end]
> 
> #and another constants set if we are in rootline 1450:
> 
> [PIDinRootline = 1450]
> homeID = 1450
> catId = 1,9,19
> showListId = 1451
> showEventId = 1452
> [end]
> 
> ------------
> one single constants TS on the rootpage
> is that the faster way for rendering?
> or put an ext TS template on page 703 with the constants set in it
> homeID = 703
> catId = 1,6,18
> showListId = 946
> showEventId = 945
> 
> Thanks for your hints so far.
> Sven

I feel the later must be the faster one;
resoning:
- the smaller the TS (php array later on) the faster
- so you would have a smaller TS on ALL pages and a slightly larger one 
on only this page and its branch below.
hth regards georg


More information about the TYPO3-performance mailing list