[TYPO3] wrap menu-item based on condition
JoH
info at cybercraft.de
Thu May 18 16:33:59 CEST 2006
>> certain menu-items need a different css class.
>> What should come in place of ####ID####? I've tried several words, but
>> none of them is working.
>>
>> Perhaps my tscript contains some other error?
>>
>>
>> lib.menu_1{
>> 1 = TMENU
>> 1.expAll = 1
>> [####ID####=44,39,40]
>> 1.NO.wrapItemAndSub = <li class="BL">|</li>
>> [ELSE]
>> 1.NO.wrapItemAndSub = <li>|</li>
>> [END]
>>
>> 2 = TMENU
>> 2.wrap = <ul>|</ul>
>> 2.NO.wrapItemAndSub = <li>|</li>
>> 2.expAll = 1
>> 3 = TMENU
>> 3.wrap = <ul>|</ul>
>> 3.NO.wrapItemAndSub = <li>|</li> 3.expAll = 1
>> }
>
> Hi David. You can't use Conditions inside {} brackets.
> And you won't be able to use conditions to set the classes either, as
> conditions doesn't work on menuitems.
>
> Usually you can use the "if" property, along with it's property "inList",
> but that won't work in you case either, because you can't use the "if"
> property on "wrapItemAndSub", as "wrapItemAndSub" doesn't have stdWrap.
> The easiest solution would be to write a small IProcFunc, that adds a
> class if the page is one of those 3 IDs.
Since the relevant part of wrapItemAndSub is the part after the | you could
move the first part of wrapItemAndSub into allWrap and use stdWrap there.
1 = TMENU
1 {
expAll = 1
NO {
allWrap.cObject = TEXT
allWrap.cObject {
value = <li>|
override = <li class="BL">|
override.if.value = 44,39,40
override.if.isInList.field = uid
}
wrapItemAndSub = |</li>
}
}
Joey
More information about the TYPO3-english
mailing list