[TYPO3] Output COA only if HMENU/TMENU is not empty

Martin Rud typo3 at explizit.dk
Tue Feb 21 08:40:02 CET 2006


Hi list,

In the following TS I have a problem: I want the "temp.submenu" obejct 
_only_ to be outputted if the "temp.menu_1"/"temp.submenu.20" object is 
_not_ empty.

How do I do that?

And, if possible, how do I output another object (i.e. a COA object) 
_if_ the "temp.menu_1"/"temp.submenu.20" object _is_ empty?

Regards,
Martin Rud


<--------- TS snippet start -------------->

# Create submenu with entry on second level
temp.menu_1 = HMENU
temp.menu_1 {
   entryLevel = 1
}
temp.menu_1.1 = TMENU
temp.menu_1.2 = TMENU

temp.menu_1.1 {
   NO.ATagTitle.field = title
   NO.allWrap = <div class="menulevel1"> | </div>
   ACT < NO
}
temp.menu_1.2 {
   NO.ATagTitle.field = title
   NO.allWrap = <div class="menulevel2"> | </div>
   ACT < NO
}

# Create text-object with the title of the parent menu-item
temp.submenuTitle = TEXT
temp.submenuTitle {
   data = leveltitle :1
   wrap = <h1> | :</h1>
}

# Combine text-object and menu so the text-object becomes the header of 
the menu
temp.submenu = COA
temp.submenu {
   10 < temp.submenuTitle
   20 < temp.menu_1
}

# Put this COA into the template
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
   template =< plugin.tx_automaketemplate_pi1
   workOnSubpart = DOCUMENT_BODY
   subparts {
     rightbarContent < temp.rightbar
     submenu < temp.submenu
}
<--------- TS snippet end -------------->



More information about the TYPO3-english mailing list