[TYPO3] Condition 'if has child pages'
Jan Slusarczyk
janslu at grupaiis.pl
Wed Mar 22 09:18:34 CET 2006
>> Therefore I have to implement a condition "Does it have children". I
>> remember a userFunction code somewhere on Typo3.org but I cannot find it...
>
> Does this help?
> http://www.google.com/search?q=site%3Atypo3.org+%2B+ifsub
Hi Christpher
Thank you, but unfortunately it doesn't...
First - the Typo3.org mail list archive doesn't work (so all of the top
Google hits don't work).
Second - The rest of the scores deal with IFSUB and IFSUB* menu
properties. It's not a menu option I need to conditionally insert, but a
whole block of two menus and a header.
Technically - it's a menu of subpages but rendered as a two column menu
with a header. Below I enclose a TS I am using to generate the menu. Now
I need to insert it only to pages that have subpages.
I think this can be done either through conditionally changing the
template file (I am using autoparser and rlmptmplselector) or by
conditionally inserting the temp.linki object in a COA:
temp.contentMain = COA
temp.contentMain {
....
20 < styles.content.get
....
}
[IFHASSUBPAGES function]
temp.contentMain.5 < temp.linki
[global]
Is there any other way to accomplish this??? Maybe I am missing
something much simpler?
Cheers
Jan
######
# Linki
######
temp.linkiLewe = HMENU
temp.linkiLewe.special = directory
temp.linkiLewe.1 = TMENU
temp.linkiLewe.1.noBlur = 1
temp.linkiLewe.1.NO{
allWrap=<li class="linki">|</li>
stdWrap.if.isFalse.prioriCalc=1
#if,register and prioricalc does not work at once in a stdWrap so use
the cObject thats created before
stdWrap.if.isFalse.cObject=TEXT
stdWrap.if.isFalse.cObject.insertData=1
stdWrap.if.isFalse.cObject.value={register:count_HMENU_MENUOBJ}%2
allWrap.if.isFalse.prioriCalc=1
allWrap.if.isFalse.cObject=TEXT
allWrap.if.isFalse.cObject.insertData=1
allWrap.if.isFalse.cObject.value={register:count_HMENU_MENUOBJ}%2
}
temp.linkiPrawe = HMENU
temp.linkiPrawe.special=directory
temp.linkiPrawe.1 = TMENU
temp.linkiPrawe.1.noBlur=1
temp.linkiPrawe.1.NO{
allWrap=<li class="linki">|</li>
stdWrap.if.isTrue.prioriCalc=1
stdWrap.if.isTrue.cObject=TEXT
stdWrap.if.isTrue.cObject.insertData=1
stdWrap.if.isTrue.cObject.value={register:count_HMENU_MENUOBJ}%2
allWrap.if.isTrue.prioriCalc=1
allWrap.if.isTrue.cObject=TEXT
allWrap.if.isTrue.cObject.insertData=1
allWrap.if.isTrue.cObject.value={register:count_HMENU_MENUOBJ}%2
}
temp.linki = COA
temp.linki {
10 = TEXT
10.value = <div id="linkiMenu">
15 = TEXT
15.value = <div id="linkiMenuLewe"><ul>
20 < temp.linkiLewe
25 = TEXT
25.value = </ul></div><div id="linkiMenuPrawe"><ul>
30 < temp.linkiPrawe
35 = TEXT
35.value = </ul></div>
40 = TEXT
40.value = <div style="clear:left"></div><br/><br/></div>
}
More information about the TYPO3-english
mailing list