显示 TMENU.2,即使它没有子菜单点(但有内容)
这可能听起来很奇怪,但我有一个菜单,其中第一页没有真正的子页面。然而,它有一个附加的 COA,带有 2 个自定义 TMENU 和一个插件插入。
但是:仅当我向此页面添加可见子页面时才会生成此页面的子导航(这将是一个解决方法)。有没有更好的解决方案来让这个菜单可见?
这是打字稿:
field_main_navigation = HMENU
field_main_navigation {
1 = TMENU
1 {
expAll = 1
NO. wrapItemAndSub = <div class="wrap-itemAndSub">|</div>
ACT < .NO
ACT = 1
ACT.ATagParams = class="active"
}
2 = TMENU
2 {
wrap = <div class="sub clearfix" style="display: none;">|</div>
# Custom build for page 2
stdWrap.wrap.append = COA
stdWrap.wrap.append {
if.value.field = pid
if.equals = 2
# a lot of typoscript, basically:
# two COA's, one with two HMENU, the
# other one with plugin content
10 = COA
# ...
20 = COA
# ...
}
NO = 1
NO {
allWrap = <li>|</li>
}
}
}
解释我想要实现的目标
基本上它是一个简单的“悬停时显示子菜单”。只是第一项 其悬停子菜单中有特殊内容。因为没有实际的 [ nav 1 ] 包含的子页面,不呈现任何子菜单。
[ nav 1 ] [ nav 2 ] [ nav 3 ]
|------div.sub style="display: none;" *-------|
| ( Custom TMENU ) | (Plugin Content) |
| | |
|--------------------|------------------------|
| ( Custom TMENU ) | ( Usual submenu ** )|
| | |
|---------------------------------------------|
* Pops out when hovering over [ nav 1 ]
** this _may_ be the case in the future, but
currently not. here's the problem
这让我想到了另一个问题(刚才):我应该在常用的 HMENU/TMENU 中执行所有这些操作,还是应该渲染正常的 HMENU/TMENU 并在前面添加 nav-1 作为带有自定义子导航层的打字生成的自定义导航点?
This may sound strange, but I have a menu where the first page has no real subpages. However, it has an appended COA with 2 custom TMENU's and a plugin insertion.
But: The subnavigation for this page is only generated when I add a visible subpage to this page (which would be a workaroud). Is there a better solution to get this menu visible?
Here's the typoscript:
field_main_navigation = HMENU
field_main_navigation {
1 = TMENU
1 {
expAll = 1
NO. wrapItemAndSub = <div class="wrap-itemAndSub">|</div>
ACT < .NO
ACT = 1
ACT.ATagParams = class="active"
}
2 = TMENU
2 {
wrap = <div class="sub clearfix" style="display: none;">|</div>
# Custom build for page 2
stdWrap.wrap.append = COA
stdWrap.wrap.append {
if.value.field = pid
if.equals = 2
# a lot of typoscript, basically:
# two COA's, one with two HMENU, the
# other one with plugin content
10 = COA
# ...
20 = COA
# ...
}
NO = 1
NO {
allWrap = <li>|</li>
}
}
}
To explain what I want to achieve
Basically it is a simple "show submenu on hover". Just the first item
has special content in its hover submenu. Because there are no actual
subpages that [ nav 1 ] contains, no submenu is rendered.
[ nav 1 ] [ nav 2 ] [ nav 3 ]
|------div.sub style="display: none;" *-------|
| ( Custom TMENU ) | (Plugin Content) |
| | |
|--------------------|------------------------|
| ( Custom TMENU ) | ( Usual submenu ** )|
| | |
|---------------------------------------------|
* Pops out when hovering over [ nav 1 ]
** this _may_ be the case in the future, but
currently not. here's the problem
That lead me to another question (just now): Should I do all this in my usual HMENU/TMENU or should I render a normal HMENU/TMENU and prepend nav-1 as a typoscript-generated custom navigation point with custom subnavigation layer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将您的自定义内容放在第一级菜单设置上。试试这个:
注意:我对第二个 TMENU 上的换行有点困惑。第一级项目是否有任何真正的子页面?
Place your custom content on the first level menu setup. Try this:
NOTE: I'm a bit confused by the wrap on the second TMENU. Do any of the 1st level items have any real subpages?