setup ( typoscript )
# setup.typoscript
lib.mainMenu = HMENU lib.mainMenu { special = list special.value = 1,2,3 1 = TMENU 1 { wrap = <ul>|</ul> expAll = 1 NO = 1 NO { wrapItemAndSub = <li>|</li> allWrap = <div class="menu-item">|</div> ATagTitle.field = title stdWrap.htmlSpecialChars = 1 stdWrap.dataWrap = <span class="title">|</span> } IFSUB = 1 IFSUB { wrapItemAndSub = <li>|</li> allWrap = <div class="submenu">|</div> ACTIFSUB = 1 } ACT = 1 ACT < .NO ACT { wrapItemAndSub = <li class="active">|</li> stdWrap.dataWrap = <span class="title">|</span> } } 2 < .1 2 { stdWrap.wrap = <div class="submenu">|</div> } 3 < .2 } lib.mainMenu.dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor 10 { special = list special.value = 1,2,3 levels = 3 as = menuItems expandAll = 1 includeSpacer = 1 # Add custom processing for thumbnail images noUniqueLink = 1 noUniqueLink { wrapItemAndSub = <li>|</li> allWrap = <div class="menu-item">|</div> ATagTitle.field = title stdWrap.htmlSpecialChars = 1 stdWrap.dataWrap = <span class="title">|</span> field = subtitle fieldRequired = subtitle additionalParams.data = field:uid additionalParams.wrap = |.jpg } } }
Additional example to fetch data from specific directory.
#setup.typoscript
lib.myMenu = HMENU lib.myMenu { special = list special.value = 1,2,3 1 = TMENU 1 { wrap = <ul>|</ul> expAll = 1 NO = 1 NO { wrapItemAndSub = <li>|</li> stdWrap.cObject = COA stdWrap.cObject { 10 = TEXT 10.data = field:title 10.wrap = | 10.typolink.parameter.field = uid } } ACT < .NO ACT { wrapItemAndSub = <li class="active">|</li> } IFSUB < .NO IFSUB { ATagParams = class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" wrapItemAndSub = <li class="dropdown">|</li> linkWrap = | <b class="caret"></b> stdWrap.outerWrap = <ul class="dropdown-menu">|</ul> } } 2 = TMENU 2 { wrap = <ul class="dropdown-menu">|</ul> NO = 1 NO { wrapItemAndSub = <li>|</li> stdWrap.cObject = COA stdWrap.cObject { 10 = TEXT 10.data = field:title 10.wrap = | 10.typolink.parameter.field = uid } } ACT < .NO ACT { wrapItemAndSub = <li class="active">|</li> } IFSUB < .NO IFSUB { wrapItemAndSub = <li>|</li> linkWrap = | <b class="caret"></b> stdWrap.outerWrap = <ul class="dropdown-menu">|</ul> } } 3 = TMENU 3 { wrap = <ul class="dropdown-menu">|</ul> NO = 1 NO { wrapItemAndSub = <li>|</li> stdWrap.cObject = COA stdWrap.cObject { 10 = TEXT 10.data = field:title 10.wrap = | 10.typolink.parameter.field = uid } } ACT < .NO ACT { wrapItemAndSub = <li class="active">|</li> } IFSUB < .NO IFSUB { wrapItemAndSub = <li>|</li> linkWrap = | <b class="caret"></b> stdWrap.outerWrap = <ul class="dropdown-menu">|</ul> } } } lib.myMenu.1.dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor 10 { special = directory special.value.field = uid levels = 3 as = menu } }