[英]TYPO3 menu with typoscript no code generate
我想用Typoscript創建一個菜單,但這是行不通的。
我沒有代碼生成。 我的<body>
是空的。
這是我的打字稿代碼:
# 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 {
}
這是幫助我制作菜單的教程: http : //wiki.typo3.org/Templating_Tutorial_-__Basics
您在NAVMENU
配置之間有一個METANAV
:
NAVMENU = HMENU
NAVMENU.wrap = <ul>|</ul>
# Only display special pages here: Contact and Imprint
METANAV.special = list
將最后一行也更改為NAVMENU
或使用花括號。 確保在您的Template html文件中存在一個DOCUMENT
子部分,並且在該子部分中存在一個NAVMENU
子部分。 只有這樣,您才能看到輸出。
丹尼爾的答案是正確的。
菜單有不同的狀態。 NO是默認狀態,您無需停用它( 這是錯誤的:NO = 0 )。 僅當需要更多狀態時,才需要設置每個狀態,例如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.