[TYPO3-english] TMENU custom list

JoH asenau info at cybercraft.de
Thu Jun 3 11:39:51 CEST 2010


Varga Zsolt wrote:
> Hi,
> 
> I am stucked with my delicious problem,
> 
> namely I have a TMENU used to show menu by the page structure.
> 
> However, I need for one level 1 (precisely the the 4th main menu item)
> menu to display a custom list as a submenu (so I wanna set up a manual
> array), not its usualy subpages in the level 2 menu.

So I guess you know the ID of that particular page?
In this case you could disable the link generation for all itmes having a pid=ID and then use ifEmpty on the TMENU (which should be empty then) to replace it with your own code.

Something like that:

lib.topmenu {
  2 = TMENU
  2 {
    stdWrap.wrap = <div class="co"><ul> | <p></p></ul></div>
    stdWrap.ifEmpty.cObject = COA
    stdWrap.ifEmpty.cObject {
      # this will be used, when items in the menu are disabled
      # your TS elements here
    }
    NO = 1
    NO {
      allWrap = <li> | </li>
      ATagParams = |*||*| style="" || style="background:none"
      allStdWrap.if {
        # this will disable the whole item when ID is 123
        value = 123
        equals.field = pid
        negate = 1
      }
    }
    ACT < .NO
    ACT {
      allWrap = <li class="active"> | </li>
      ATagParams >
    }
  }
}

and BTW: You should use wrapItemAndSub for the items of the first menu instead of allWrap with a closing <li> in the wrap of the 2nd TMENU

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


More information about the TYPO3-english mailing list