Display the value one object only when the other object value is faslse

Hello!

In some cases we want to display the value of object only when the value of the other object is false or null. For this to work we use the typoscript cobject with the negate option.

The Following code depicts how to display the PREVIOUS and NEXT buttons in the typoscript prev/next menu. When using the prev/next menu code the prev button does not appear on the first page and next button on the last. But for some purpose we need to have these buttons but without the link.

The following code helps to solve this problem.

lib.prevNext = COA
lib.prevNext{
1 = TEXT
1.value = PREVIOUS
1.stdWrap.if.negate =1
1.stdWrap.if.isTrue.cObject = HMENU
1.stdWrap.if.isTrue.cObject {
special = browse
special {
items = prev
items.prevnextToSection = 1
prev.fields.title = PREVIOUS
}

1 = TMENU
1.NO {
linkWrap = <div class=”button”> | </div>
stdWrap.htmlSpecialChars = 1
}
}

2 = HMENU
2{
special = browse
special {
items = prev|next
items.prevnextToSection = 1
prev.fields.title = PREVIOUS
next.fields.title = NEXT
}

1 = TMENU
1.NO {
linkWrap = <div class=”button”> | </div>
stdWrap.htmlSpecialChars = 1
}
}

3 = TEXT
3.value = NEXT
3.stdWrap.if.negate =1
3.stdWrap.if.isTrue.cObject = HMENU
3.stdWrap.if.isTrue.cObject {
special = browse
special {
items = next
items.prevnextToSection = 1
prev.fields.title = PREVIOUS
}

1 = TMENU
1.NO {
linkWrap = <div class=”button”> | </div>
stdWrap.htmlSpecialChars = 1
}
}
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark