内容导航帮助
我正在用打字稿进行内容导航。这些要求应该完成:
- 在顶部显示当前节点->完成了!
- 显示当前页面的所有子节点->完成了!
- 如果没有子节点,则显示当前页面处于活动状态的最后一个树级别 - 尚未完成!
对于最后一点,我需要帮助。我尝试使用 [treelevel = 2]
来控制最后一个树级别的导航,但没有任何反应。不知道为什么,但树级条件对我不起作用。另一个问题是,有时最后一个树级别在第二层,有时在第三层......
有什么想法吗?
这是到目前为止的打字稿:
temp.leftCol = COA
temp.leftCol {
5 = HTML
5.value = <ul class="contentNav">
### show current page on top
10 = TEXT
10.typolink {
parameter.data = TSFE:id
}
10 {
wrap = <li class="title">|</li>
data = leveltitle:2
if {
isTrue.numRows {
table = pages
}
}
}
### content navigation: show subpages
20 = HMENU
20.entryLevel = -1
20.1 = TMENU
20.1 {
noBlur = 1
NO = 1
CUR = 1
expAll = 1
}
20.1.NO {
wrapItemAndSub = <li>|</li>
stdWrap.wrap = |
allStdWrap.insertData = 1
}
20.1.CUR {
wrapItemAndSub = <li class="on">|</li>
stdWrap.wrap = |
allStdWrap.insertData = 1
}
20.1.wrap = |</ul>
}
I'm working on a content navigation in typoscript. These requirements should be accomplished:
- show the current node at the top -> is done!
- show all child nodes of the current page -> is done!
- if there are no child nodes, show last treelevel with with the current page active - not done yet!
For the last point, I need help. I tried to do something with [treelevel = 2]
to control the navigation on the last treelevel, but nothing happened. Don't know why but the treelevel-condition won't work for me. Another problem is, sometimes the last treelevel is on 2nd level, sometimes on 3rd...
any ideas?
This is the typoscript so far:
temp.leftCol = COA
temp.leftCol {
5 = HTML
5.value = <ul class="contentNav">
### show current page on top
10 = TEXT
10.typolink {
parameter.data = TSFE:id
}
10 {
wrap = <li class="title">|</li>
data = leveltitle:2
if {
isTrue.numRows {
table = pages
}
}
}
### content navigation: show subpages
20 = HMENU
20.entryLevel = -1
20.1 = TMENU
20.1 {
noBlur = 1
NO = 1
CUR = 1
expAll = 1
}
20.1.NO {
wrapItemAndSub = <li>|</li>
stdWrap.wrap = |
allStdWrap.insertData = 1
}
20.1.CUR {
wrapItemAndSub = <li class="on">|</li>
stdWrap.wrap = |
allStdWrap.insertData = 1
}
20.1.wrap = |</ul>
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你这到底是什么意思?
如果没有子节点,则显示当前页面处于活动状态的最后一个树级别 - 尚未完成!
据我了解,可能是
1) 假设第 1 层有 10 个页面,除了第 7 页之外,每个页面都有 3 个子页面。假设第 7 页没有子页面。然后,当我转到第 7 页时,它将显示第 7 页为活动状态,但在其下方显示第 6 页(“显示最后一个树级别”)的子页面。
或者
2) 当用户导航到第 7 页时,它会将第 7 页显示为活动页面,以及用户之前访问过的任何页面的子页面?例如,如果我先导航到第 2 页,然后转到第 7 页,我将看到第 7 页处于活动状态,并且看到第 2 页的子页面。
What do you mean by this exactly?
if there are no child nodes, show last treelevel with with the current page active - not done yet!
As I understand it, it could be either
1) Letssay that there are 10 pages on level 1, and every one of those pages except page 7 have 3 subpages each. And letssay page 7 has no subpages. Then, when I go to page 7, it will display page 7 as active, but display subpages from page 6 (the "show last treelevel") under it.
or
2) When user navigates to page 7, it displays page 7 as active, and subpages for whatever page the user has been right before that? So that for example, if I navigate to page 2 first, and then go to page 7, I will see page 7 as active, and subpages for page 2.