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?
NO.wrapItemAndSub = <div class="wrap-itemAndSub">|XXX</div>
– tmtHMENU
. My answer takes into account that that page might not be there. Does it work for you? – tmt