[TYPO3-english] Need typoscript help

Gregor Hermens gregor at a-mazing.de
Mon Nov 25 12:16:29 CET 2013


Hi Arun,

PIT Solutions wrote:

> I've a main menu typoscript,
> 
> lib.mainmenu = HMENU
> lib.mainmenu.special = directory
> lib.mainmenu.special.value = 4
> lib.mainmenu.1 = TMENU
> lib.mainmenu.1{
>   wrap = <ul>|</ul>
>   NO {
>     stdWrap.htmlSpecialChars = 1
>     allWrap = <li>|</li>|*|<li>|</li>|*|<li class="last">|</li>
>   }
> }
> 
> This is working. But my requirement is, I need to wrap a <span> tag inside
> the <li> tag if subpage of that page exists. For example, I've 3 pages and
> the second page has subpages, then the html should be,
> 
> <ul>
> <li>
> <a>Test 1</a>
> </li>
> <li>
> <a>Test 2</a>
> <span></span>
> </li>
> <li class="last">
> <a>Test 3</a>
> </li>
> </ul>
> 
> Here I 've subpages for Test 2 page. In this case I need to place a span
> stag inside that <li>.

there is a special item state IFSUB:

http://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/CommonItemStates/Index.html

lib.mainmenu = HMENU
lib.mainmenu.special = directory
lib.mainmenu.special.value = 4
lib.mainmenu.1 = TMENU
lib.mainmenu.1{
  wrap = <ul>|</ul>
  NO {
    stdWrap.htmlSpecialChars = 1
    allWrap = <li>|</li>|*|<li>|</li>|*|<li class="last">|</li>
  }
  NO = 1
  IFSUB < .NO
  IFSUB.stdWrap2 = |<span></span>
}

hth
Gregor
-- 
http://www.a-mazing.de/   |   Certified TYPO3 Integrator



More information about the TYPO3-english mailing list