TYPO3: Making a simple menu as an unordered list in XHTML

This example how to make a menu as an unordered list, by enabling ACT (active) and CUR (current) it sets the <li> tags with attributes class=”active” and id=”current” respectively. The current page is wrapped in <span> and not linked.


## MainMenu [Begin]
lib.mainMenu = HMENU
lib.mainMenu.entryLevel = 0
lib.mainMenu.wrap =

    |

lib.mainMenu.1 = TMENU
lib.mainMenu.1 {
noBlur = 1
ACT = 1
CUR = 1
}
lib.mainMenu.1.NO {
allWrap =

  • |
  • }
    lib.mainMenu.1.ACT {
    allWrap =

  • |
  • }
    lib.mainMenu.1.CUR {
    allWrap =

  • |
  • doNotLinkIt = 1
    }
    ## MainMenu [End]

    The above example can be extended using field:title and field:subtitle, if a specific id for styling is needed or if some information should be placed as value in the title attribute.


    lib.mainMenu.1.NO {
    allWrap =

  • |
  • ATagParams.dataWrap = id="{field:title}" title="{field:subtitle}"
    }
    lib.mainMenu.1.ACT {
    allWrap =

  • |
  • ATagParams.dataWrap = id="{field:title}" title="{field:subtitle}"
    }

    This entry was posted in TYPO3/TypoScript. Bookmark the permalink.

    3 Responses to TYPO3: Making a simple menu as an unordered list in XHTML

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.