问题描述
这听起来可能很奇怪,但我有一个菜单,其中第一页没有真正的子页.然而,它有一个附加的 COA,带有 2 个自定义 TMENU 和一个插件插入.
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?
这是印刷文字:
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 ] 包含的子页面,不呈现子菜单.
To explain what I want to achieve
Basically it is a simple "show submenu on hover". Just the first itemhas special content in its hover submenu. Because there are no actualsubpages 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
这让我想到了另一个问题(刚才):我应该在通常的 HMENU/TMENU 中执行所有这些操作,还是应该渲染一个普通的 HMENU/TMENU 并将 nav-1 作为带有自定义子导航的排版生成的自定义导航点添加到前面层?
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?
推荐答案
将您的自定义内容放在第一级菜单设置上.试试这个:
Place your custom content on the first level menu setup. Try this:
field_main_navigation = HMENU
field_main_navigation {
1 = TMENU
1 {
expAll = 1
NO.wrapItemAndSub {
append = COA
append {
if {
value.field = uid
equals = 2
}
# a lot of typoscript, basically:
# two COA's, one with two HMENU, the
# other one with plugin content
10 = COA
# ...
20 = COA
# ...
}
wrap3 = <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>
NO = 1
NO {
allWrap = <li>|</li>
}
}
}
注意:我对第二个 TMENU 的包装有点困惑.是否有任何 1 级项目有任何真正的子页面?
NOTE: I'm a bit confused by the wrap on the second TMENU. Do any of the 1st level items have any real subpages?
这篇关于即使没有子菜单点(但有内容)也显示 TMENU.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!