[TYPO3] TMENU conditional

JoH info at cybercraft.de
Thu Jun 1 23:47:49 CEST 2006


> I'm trying to make a menu that displays items with abstracts
> different from those without abstracts.  I can't figure out a
> conditional that will work.
>
> Does anyone know how I could do that?  My code looks like this.
>
>  1.  ###########################################
>  2.  # News
>  3.  temp.news_list = HMENU
>  4.  temp.news_list.special = directory
>  5.  temp.news_list.special.value = 153 # the starting point of the
> menu
>  6.  temp.news_list.maxItems = 0
>  7.  temp.news_list.1 = TMENU
>  8.  temp.news_list.1 {
>  9.  [current menu item's abstract field is empty]
> 10.  # Some TS here.
> 11.  [else]
> 12.  # Some TS here.
> 13.  [end]
> 14.  }
> 15.  #------------------------------------------

Use an if-statement on the allWrap property:

temp.news_list = HMENU
temp.news_list {
    special = directory
    special.value = 153
    1 = TMENU
    1 {
        NO {
            allWrap.cObject = COA
            allWrap.cObject {
                10 = TEXT
                10.value = <div class="has_abstract">|</div>
                10.if.isTrue.field = abstract
                20 = TEXT
                20.value = <div class="no_abstract">|</div>
                20.if.isFalse.field = abstract
            }
        }
    }
}

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de





More information about the TYPO3-english mailing list