I have to implement a new responsive Navigation for a client which uses TYPO3. I didn't build the site and I've never used Typo3 before.
Could anyone help me to understand how I can implement this Template or something similar: https://demo.sebkln.de/hmenu/?type=3
So far I replaced the TypoScript Code in the projects "default_navbar.ts" and I found a way to load smartmenus js & css. The Problem right now is: The Code for the new Navbar does not show up. I guess I need to edit some template as well?
If someone knows a better way to update a already written Navbar, you're welcome to suggest something. The current Navbar has 3 Levels. Every little answer helps me a lot.
Old Navi (non responsive)
lib.default_navbar = HMENU
lib.default_navbar {
wrap (
<div class="navbar navbar-default with-hover">
<div class="container">
<div class="navbar-collapse" id="bs-navbar-collapse-1">
|
</div>
</div>
</div>
)
entryLevel = 0
1 >
1 = TMENU
1 {
noBlur = 1
expAll = 1
wrap = <ul class="nav navbar-nav"><li class="home"><a class="navbar-brand" href="/"><i class="fa fa-home"></i></a></li>|</ul>
NO = 1
#NO.stdWrap.htmlSpecialChars = 0
#NO.wrapItemAndSub.insertData=1
#NO.wrapItemAndSub = <li class="first m{field:uid} p{field:pid}">|</li> |*| <li class="m{field:uid} p{field:pid}">|</li> |*| <li class="last m{field:uid} p{field:pid}">|</li>
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
stdWrap.wrap = <i class="fa fa-angle-right"></i>|
}
ACT < .NO
ACT {
wrapItemAndSub = <li class="first act">|</li> |*| <li class="act">|</li> |*| <li class="act last">|</li>
stdWrap.wrap = <i class="fa fa-angle-right"></i>|
}
CUR < .NO
CUR {
wrapItemAndSub = <li class="first act cur">|</li> |*| <li class="act cur">|</li> |*| <li class="act cur last">|</li>
stdWrap.wrap = <i class="fa fa-angle-right"></i>|
}
}
2 = TMENU
2 {
noBlur = 1
expAll = 1
wrap = <ul class="dropdown-menu" role="menu">|</ul>
NO = 1
NO.wrapItemAndSub.insertData=1
NO.wrapItemAndSub = <li class="first m{field:uid}">|</li> |*| <li class="m{field:uid}">|</li> |*| <li class="last m{field:uid}">|</li>
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
stdWrap.wrap = <i class="fa fa-angle-right"></i>|
}
ACT < .NO
ACT {
wrapItemAndSub= <li class="first act first_act m{field:uid}">|</li> |*| <li class="act m{field:uid}">|</li> |*| <li class="last act m{field:uid}">|</li>
stdWrap.wrap = <i class="fa fa-angle-right"></i>|
}
CUR < .NO
CUR {
wrapItemAndSub= <li class="first act cur first_act first_cur m{field:uid}">|</li> |*| <li class="act cur m{field:uid}">|</li> |*| <li class="last act cur m{field:uid}">|</li>
stdWrap.wrap = <i class="fa fa-angle-right"></i>|
}
SPC = 0
}
}
Navi I would like to use
lib.bootstrap3-smartmenus = COA
lib.bootstrap3-smartmenus {
wrap = <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> | </div> </nav>
10 = COA
10 {
wrap = <div class="navbar-header"> | </div>
10 = COA
10 {
// hamburger icon:
wrap = <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | </button>
10 = TEXT
10.value = <span class="sr-only">Toggle navigation</span>
20 = TEXT
20.value = <span class="icon-bar"></span>
21 < .20
22 < .20
}
// company name/logo:
20 = TEXT
20.value = Project name
20.typolink {
parameter = https://www.example.org/
ATagParams = class="navbar-brand"
}
}
20 = COA
20 {
wrap = <div class="navbar-collapse collapse"> | </div>
10 = HMENU
10 {
wrap = <ul class="nav navbar-nav"> | </ul>
1 = TMENU
1 {
expAll = 1
NO = 1
NO {
ATagTitle.field = title
wrapItemAndSub = <li>|</li>
// Set 'active' class to shortcuts that link to the current page (e.g. useful when 'Home' is root page):
wrapItemAndSub.override.cObject = COA
wrapItemAndSub.override.cObject {
if {
value = 4
equals.field = doktype
isTrue = 1
isTrue.if {
value.data = TSFE:page|uid
equals.field = shortcut
}
}
10 = TEXT
10.value = <li class="active">|</li>
}
}
CUR < .NO
CUR {
wrapItemAndSub = <li class="active">|</li>
}
IFSUB = 1
IFSUB {
ATagTitle.field = title
ATagParams = class="sub-arrow"
linkWrap = |<span class="caret"></span>
ATagBeforeWrap = 1
wrapItemAndSub = <li>|</li>
}
CURIFSUB < .IFSUB
CURIFSUB {
wrapItemAndSub = <li class="active">|</li>
}
ACT < .CUR
ACTIFSUB < .CURIFSUB
SPC = 1
SPC {
// no divider, if first menu item on this level (using optionSplit):
wrapItemAndSub = <li class="dropdown-header">|</li> |*| <li class="divider"></li><li class="dropdown-header">|</li>
}
}
2 < .1
2 {
wrap = <ul class="dropdown-menu">|</ul>
}
3 < .2
4 < .3
}
}
}