[TYPO3] Onlyshow submenu when elements

JoH asenau info at cybercraft.de
Thu Dec 7 19:12:41 CET 2006


> I have a submenu with a header above. But when there is no elements
> on the level (submenu empty), I don't want to show the header.
>
> I have tried using the Required flag in the wrap option, but I can't
> get it to work.
>
> Heres my typoscript:
> *******************************************************************
> ## Menu [Begin]
> lib.subMenu = HMENU
> lib.subMenu.wrap = <h3>See also...</h3><ul>|</ul>
>
> lib.subMenu.entryLevel = 1
>
> lib.subMenu.1 = TMENU
> lib.subMenu.1.NO {
>  allWrap = <li class="sublink-normal">-&nbsp;&nbsp;&nbsp;|</li>
> }
>
> lib.subMenu.1.ACT = 1
> lib.subMenu.1.ACT {
>  allWrap = <li class="sublink-active">-&nbsp;&nbsp;&nbsp;|</li>
> }
> ## Menu [End]
> *******************************************************************
>
> It's probably not so hard :)

Exactly.

Simply move the wrap from the HMENU part to the TMENU part.
TMENU will wrap only, if there are items in the menu.

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/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list