[TYPO3-dev] Avoid rendering menu based on number of items
John Angel
johnange at gmail.com
Mon Apr 28 11:41:58 CEST 2008
Hi,
In the code bellow, no matter of stdWrap.if condition, Typo3 is always making the complete menu tree like it will be displayed. I understand this is behavior by TS design.
submenu = HMENU
submenu {
entryLevel = 1
1 = TMENU
1.NO.allWrap = |
stdWrap.if {
value.data = register:count_menuItems
isLessThan = 1
isGreaterThan = 5
}
}
So the process is something like this:
{count menu items}
{build menu - calling typoLink for every single page}
{check is number of menu items is larger than 1 and smaller than 5} => display menu or not
Is there some workaround to process the condition first, like this:
{count menu items}
{check is number of menu items is larger than 1 and smaller than 5} => next step or exit
{build menu - calling typoLink for every single page}
The reason is simple - if I have 500 pages, I wouldn't want to waste time on building menu which will not be displayed. Especially in the latest Typo3 v4.2 which is checking rootline for all 500 pages using typoLink function.
Regards,
John
More information about the TYPO3-dev
mailing list