[TYPO3-english] Need typoscript help

PIT Solutions typo3 at pitsolutions.com
Mon Nov 25 13:08:34 CET 2013


Hi Gregor,

Thanks a lot. It works...:)

Regards,
Arun


________________________________
 From: Gregor Hermens <gregor at a-mazing.de>
To: typo3-english at lists.typo3.org 
Sent: Monday, November 25, 2013 4:46 PM
Subject: Re: [TYPO3-english] Need typoscript help
 

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

_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list