Is it possible to insert the parent link to sub menu list. It should looks like this:
Parent link
|--Parent link
|--Subpage link1
|--Subpage link
I need this for bootstrap menu where every parent link is only clickable (to expand the sub menu)
My menu looks like this:
lib.header-menu = HMENU
lib.header-menu.entryLevel = 0
lib.header-menu {
1 = TMENU
1 {
wrap = <nav class="navbar navbar-default" role="navigation"><ul class="nav navbar-nav">|</ul></nav>
expAll = 1
NO {
ATagTitle.field = title
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
accessKey = 1
}
IFSUB < .NO
IFSUB = 1
IFSUB {
wrapItemAndSub = <li class="dropdown">|</li>
linkWrap= |<span class="caret"></span>
ATagParams = class="dropdown-toggle" role="button" data-toggle="dropdown"
ATagBeforeWrap = 1
stdWrap.htmlSpecialChars = 1
}
ACTIFSUB < .IFSUB
ACTIFSUB {
wrapItemAndSub = <li class="active dropdown">|</li>
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
}
CURIFSUB < .IFSUB
CURIFSUB = 1
CURIFSUB {
wrapItemAndSub = <li class="active dropdown">|</li>
}
}
# second level
2 = TMENU
2.wrap = <ul class="dropdown-menu">|</ul>
2{
expAll = 1
NO{
ATagTitle.field = title
wrapItemAndSub = <li>|</li>
}
IFSUB = 1
IFSUB{
ATagTitle.field = title
wrapItemAndSub = <li>|</li>
}
}
}
One solution is to include an additional subpage with a shortcut to the parent page. This requires manual labour though and can be forgotten.
You could also use typoscript to get it done. I've changed the wrapper on the 2nd item so it's build up as COA with several parts, and created a typolink to field:pid (its parent). By leaving the text value empty, typolink will create a link with the title of the page being linked to. Solving the problem of retrieving the title of the parent page on the go.
This creates a block where each parent page automatically is the first subpage item as well.