Search code examples
menutypo3typoscript

TYPO3 menu with typoscript no code generate


I want to create a menu with Typoscript, but it's doesn't work.

I have no code generate. My <body> is empty.

Here my Typoscript code:

# Default PAGE object:

page = PAGE
page.10 = TEMPLATE
page.10.template = FILE
page.10.template.file = fileadmin/templates/template.html
page.shortcutIcon = fileadmin/templates/favicon.png
page.stylesheet = fileadmin/templates/css/styles.css

page.10.workOnSubpart = DOCUMENT

######################################################
#
# Configuration of SUBPARTS
#
######################################################

# Define the subparts, which are inside the subpart DOCUMENT
page.10.subparts {

  ##############################################
  #
  # Subpart NAVMENU
  #
  ##############################################

  # The subpart NAVMENU outputs the meta navigation
  # at the top right corner of the page
  NAVMENU = HMENU
  NAVMENU.wrap = <ul>|</ul>

  # Only display special pages here: Contact and Imprint
  METANAV.special = list
  # LIST NEEDS MODIFICATION:
  # Take your page IDs!
  # Change the values in the following list!
  NAVMENU.special.value = 70, 92, 74, 91

  NAVMENU.1 = TMENU
  NAVMENU.1 {

    # NO: default formatting
    NO = 0
    NO {
      # Each entry is wrapped by
      # <li> </li>
      allWrap = <li>|</li>
    }
  }
}

######################################################
#
# Configuration of MARKERS
#
######################################################

# Define the markers inside the subpart DOCUMENT
page.10.marks {

}

Here is the tutorial helping me to make my menu: http://wiki.typo3.org/Templating_Tutorial_-_Basics


Solution

  • You have a METANAV in between your NAVMENU configuration:

    NAVMENU = HMENU
    NAVMENU.wrap = <ul>|</ul>
    
    # Only display special pages here: Contact and Imprint
    METANAV.special = list
    

    Change the last line to NAVMENU as well or use curly braces. Make sure in your Template html file a DOCUMENT subpart exsts and inside that subpart a NAVMENU subpart exists. Only then you will see output.