[TYPO3] If submenu is empty different COA

JoH info at cybercraft.de
Fri Mar 3 01:30:25 CET 2006


> Is it in principle possible to set
> diffrent kind of  contentArea template, if submenu is empty
>
> temp.menu_2 = HMENU
> temp.menu_2.entryLevel=2
> temp.menu_2.1 = TMENU
> {...
> }
>
> lets's make a COA 'menu_3'
>
> if menu_2 is not empty something like
>
> temp.menu_3=COA
> {
> 10 < styles.content.get
> 20=TEXT
> 20 {
> value=</td><td class="menuCell">
> }
> 30 < temp.menu_2
> 40=TEXT
> {
> value=</td>
> }
> }
>
> if empty something like
>
>
> temp.menu_3=COA
> {
> 10 < styles.content.get
>
> 20=TEXT
> {
> value=</td>
> }
> }

Sorry - but the whole approach is way too complicated.
Simply do the following:

temp.menu_2 = HMENU
temp.menu_2 {
    entryLevel=2
    1 = TMENU
    1 {
        wrap = <td class="menuCell">|</td>
        NO = 1
        NO {
            blah
        }
    }
}

temp.menu_3 = COA
temp.menu_3 {
    10 = COA
    10 {
        wrap = <td>|</td>
        10 < styles.content.get
    }
    20 < temp.menu_2
}

No "if", no "ifEmpty", no "ifNotEmpty", just a simple copy of a HMENU
element with a wrap that will be empty (and not wrapped) or not empty (and
wrapped).
Simple as that.

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