Discussion:
[TYPO3-english] Nav menu (TMENU)
Alex Borodinov
2017-10-10 11:36:03 UTC
Permalink
Hi, couldn't some help me with the menu?

I have this html markup
_________________________________________________
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services.html">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" >
Portfolio
</a>
<div class="dropdown-menu dropdown-menu-right" >
<a class="dropdown-item" href="portfolio-1-col.html">1 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-2-col.html">2 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-3-col.html">3 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-4-col.html">4 Column Portfolio</a>
<a class="dropdown-item" href="portfolio-item.html">Single Portfolio Item</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">
Blog
</a>
<div class="dropdown-menu dropdown-menu-right" >
<a class="dropdown-item" href="blog-home-1.html">Blog Home 1</a>
<a class="dropdown-item" href="blog-home-2.html">Blog Home 2</a>
<a class="dropdown-item" href="blog-post.html">Blog Post</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">
Other Pages
</a>
<div class="dropdown-menu dropdown-menu-right" >
<a class="dropdown-item" href="full-width.html">Full Width Page</a>
<a class="dropdown-item" href="sidebar.html">Sidebar Page</a>
<a class="dropdown-item" href="faq.html">FAQ</a>
<a class="dropdown-item" href="404.html">404</a>
<a class="dropdown-item" href="pricing.html">Pricing Table</a>
</div>
</li>
</ul>
</div>
_________________________________________________

I have this TS Menu setup:
_________________________________________________
lib.content_menu= HMENU
lib.content_menu {
1=TMENU
1{
noBlur=1
expAll = 1
ACT = 1
CUR = 1
NO=1
NO {
wrapItemAndSub=<li class="nav-item">|</li>
ATagTitle.field=title
ATagParams = class="nav-link"
}
IFSUB<.NO
IFSUB.ATagParams = class="nav-link dropdown-toggle" data-toggle="dropdown"
IFSUB.wrapItemAndSub=<li class="nav-item dropdown">|</li>
ACT<.NO
// ACT.wrapItemAndSub=<li class="nav-item">|</li>
// ACT.ATagParams = id="current_page_item"
CUR<.NO
CUR {
//wrapItemAndSub = <li class="nav-item">|</li>
//ATagParams = class="drop"
}
}

2<.1
2 {
//entryLevel=1
NO>
IFSUB>
NO = 1
NO.ATagParams = class="dropdown-item"
wrap=<div class="dropdown-menu dropdown-menu-right">|</div>
}
_________________________________________________

The problem is that works only on first level. When i click on subpages, the menu gets broken.
Christian Hackl
2017-10-10 16:43:25 UTC
Permalink
What do you want?

I see that you delete the "NO" and the "IFSUB" in the second level - that looks a little bit wired to me, because you copied the first level... that makes not really sense, or?
Alex Borodinov
2017-10-11 05:41:57 UTC
Permalink
i just tried to make it work normally - by deleting NO and IFSUB in second level the first level works good, but when i go on subpage, menu gets broken. Any other settings in menu setup do brake the menu on the first level too. I already just have a headache, trying to setup the menu normally on both levels. I have the whole site on TYPO3 working fine, but all i can't setup is the menu. Sorry for my english.
Alex Borodinov
2017-10-11 08:09:40 UTC
Permalink
I did it. typoscript makes you think.

lib.content_menu= HMENU
lib.content_menu {
1 = TMENU
1 {
noBlur=1
expAll = 1
ACT = 1
CUR = 1
NO = 1
NO {
wrapItemAndSub=<li class="nav-item">|</li>
ATagTitle.field=title
ATagParams = class="nav-link"
}
IFSUB<.NO
IFSUB.ATagParams = class="nav-link dropdown-toggle" data-toggle="dropdown"
IFSUB.wrapItemAndSub=<li class="nav-item dropdown">|</li>
ACTIFSUB<.IFSUB
ACTIFSUB.wrapItemAndSub=<li class="nav-item dropdown">|</li>
CURIFSUB<.IFSUB
CURIFSUB.wrapItemAndSub=<li class="nav-item dropdown">|</li>
ACT<.NO
CUR<.NO
}

2 = TMENU
2 {
wrap=<div class="dropdown-menu dropdown-menu-right">|</div>
noBlur=1
expAll = 1
ACT = 1
CUR = 1
NO = 1
NO {
ATagParams = class="dropdown-item"
}
ACT<.NO
CUR<.NO
}
}

Loading...