[英]TYPO3 menu with typoscript no code generate
I want to create a menu with Typoscript, but it's doesn't work. 我想用Typoscript创建一个菜单,但这是行不通的。
I have no code generate. 我没有代码生成。 My <body>
is empty. 我的<body>
是空的。
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 这是帮助我制作菜单的教程: http : //wiki.typo3.org/Templating_Tutorial_-__Basics
You have a METANAV
in between your NAVMENU
configuration: 您在NAVMENU
配置之间有一个METANAV
:
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. 将最后一行也更改为NAVMENU
或使用花括号。 Make sure in your Template html file a DOCUMENT
subpart exsts and inside that subpart a NAVMENU
subpart exists. 确保在您的Template html文件中存在一个DOCUMENT
子部分,并且在该子部分中存在一个NAVMENU
子部分。 Only then you will see output. 只有这样,您才能看到输出。
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 ). NO是默认状态,您无需停用它( 这是错误的:NO = 0 )。 Only if you need more states you have to set each one like ACT = 1 ( CUR = 1 and so on). 仅当需要更多状态时,才需要设置每个状态,例如ACT = 1 ( CUR = 1 ,依此类推)。
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>
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.