0
votes

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

2

2 Answers

1
votes

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.

0
votes

The answer form Daniel is right.

And there are different states of a menu. NO is the default state and you do not need to deactivate it (it's wrong: NO = 0). Only if you need more states you have to set each one like ACT = 1 (CUR = 1 and so on).

NAVMENU= HMENU 
NAVMENU {
    special = list
    special.value = 70, 92, 74, 91
    1 = TMENU
    1.wrap = <ul>|</ul>
    1{
        NO{
            wrapItemAndSub = <li class="menu-normal">|</li>
        }
        ACT=1
        ACT{
            wrapItemAndSub = <li class="menu-active">|</li>
        }
    }
}