Conditional menu based on menu page-id

Following code gives a nice way to have a custom content element as sub-menu item for each main menu item

lib.customMenu = HMENU
lib.customMenu {
 1 = TMENU
 1  {
        wrap = |
        NO.allWrap = | 
        NO.stdWrap.htmlSpecialChars = 1
        NO.after.cObject = COA
        NO.after.cObject {           
            20 = CASE
            20 {
               key.field = uid
               default = RECORDS
               default.tables = tt_content
               default.conf.tt_content < tt_content
               default.conf.tt_content.stdWrap.innerWrap >               
               
               14 < .default               
               14.source = {$submenu_element_14}
               
               15 < .default               
               15.source = {$submenu_element_15}
               
               16 < .default               
               16.source = {$submenu_element_16}
               
               17 < .default               
               17.source = {$submenu_element_17}
               
            }            
            
        }
        ACT = 1
        ACT.after.cObject < .NO.after.cObject
        ACT.allWrap = |
        ACT.ATagParams = class="act"
        ACT.stdWrap.htmlSpecialChars = 1

        CUR < .ACT
        CUR.ATagParams = class="cur"
    }
}

This code cannot be used as it is, you will need to make sure the DHTML/JavaScript code for the sub menu items are configured accordingly.

Further References:

  1. [TYPO3-english] conditional menu based on menu page-id
    http://lists.typo3.org/pipermail/typo3-english/2009-November/065557.html
  2. [TYPO3-english] Custom class in tmenu according to uid page
    http://lists.typo3.org/pipermail/typo3-english/2010-February/067336.html

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark