Sie befinden sich hier: Typo3 / Tipps / Visuelle Trennzeichen im Untermenü
Deutsch
English
Montag, 25.06.2018

In TYPO3 gibt es das Content Element Visuelle Trennzeichen für Menü, das jedoch im Typoscript für das Menü berücksichtigt werden muss. Durch den folgenden Code werden auch die visuellen Trennzeichen im Untermenü ausgegeben.

SPC = 1
SPC {
   before.dataWrap = <li class="spacer"> </li>
   doNotShowLink = 1
}

Passend hierzu muss dann noch das CSS angepasst werden (hier in fileadmin/styles/[PROJEKT]/css/navigation/nav_vlist-trans.css).

/* SPACER */
#submenu li.spacer {
   line-height:0.7em;
}

Hier eine Beispieldatei (fileadmin/styles/awokiel/TemplateRessources/submenu.txt) mit dem Typoscript für das gesamte Untermenü in einer TTV-Installation:

TypoScript
// ****** SUBMENU ******
lib.submenu = COA
lib.submenu.10 = COA
lib.submenu.10 {
        stdWrap.prefixComment = 2|Output of lib.submenu.10
        wrap = <ul id="submenu">|</ul>
        // Should begin with 20, so the user can add something here.
        20 = TEXT
        20.stdWrap.prefixComment = 2|Output of lib.submenu.10.20
        20.data = leveltitle:1
        20.ifEmpty.cObject = TEXT
        20.ifEmpty.cObject.value = YAML CSS-Framework
        20.wrap = <li id="title">|</li>

        30 = HMENU
        30 {
                stdWrap.prefixComment = 2|Output of lib.submenu.10.30
                wrap = |
                entryLevel = {$subMenuEntryLevel}
                1 = TMENU
                1 {
                        expAll = {$subMenuExpandToggle}
                        noBlur = 1
                        wrap = |
                        IProcFunc = user_IProc_dfn
                        NO = 1
                        NO.ATagTitle.field = abstract // description // subtitle
                        NO.allWrap = |<span class="hidden">.</span>
                        NO.wrapItemAndSub = <li class="first">|</li>|*|<li>|</li>|*|<li class="last">|</li>

                        # Zum Umschalten der Menudarstellung zwischen den Varianten
#                       NO.additionalParams = &M={$M}
#                       NO.additionalParams.insertData=1

                        NO.stdWrap.htmlSpecialChars = 1
                        NO.linkWrap = {$mainMenuLinkWrap}
                        NO.ATagBeforeWrap = 1
                        CUR < .NO
                        CUR = 1
                        CUR.allWrap = <strong>|</strong><span class="hidden">.</span>
                        CUR.wrapItemAndSub = <li class="first">|</li>|*|<li>|</li>|*|<li class="last">|</li>
                        CUR.doNotLinkIt = 1
                        CUR.stdWrap.htmlSpecialChars = 1
                        ACT < .NO
                        ACT = 1
                        ACT.allWrap = <strong>|</strong><span class="hidden">.</span>
                        ACT.wrapItemAndSub = <li class="active first">|</li>|*|<li class="active">|</li>|*|<li class="active last">|</li>
                        ACT.doNotLinkIt = 0
                        ACT.stdWrap.htmlSpecialChars = 0

                        SPC = 1
                        SPC {
                                before.dataWrap = <li class="spacer">&nbsp;</li>
                                doNotShowLink = 1
                        }

                        IFSUB = 1
                        IFSUB < .NO
                        IFSUB.linkWrap = {$mainMenuIfsubLinkWrap}
                }
                2 < .1
                2.wrap = <ul class="level2">|</ul>
                3 < .1
                3.wrap = <ul class="level3">|</ul>
                4 < .1
                4.wrap = <ul class="level4">|</ul>
        }
}
// Delete entire menu if user has set the appropriate option
[globalVar = LIT:1 = {$subMenuOff}]
lib.submenu.10 >
[global]
// Delete headline of menu if user has set the appropriate option
[globalVar = LIT:1 = {$menuHeadlineOff}]
lib.submenu.10.20 >
[global]