[Typo3] linkWrap, enforce closing tag
Darren Clark
typo3 at cwebd.co.uk
Mon Sep 19 01:59:18 CEST 2005
On Sun, Sep 18, 2005 at 04:35:02PM -0700, Christopher wrote:
> On 18/09/05, Darren Clark <typo3 at cwebd.co.uk> wrote:
> > I've been racking my brains about this for a while.
> >
> > I'd like to create a TMENU that creates the following code:
> >
> > <ul>
> > <li>
> >
> > (repeat this code)
> >
> > <ul>
> > <li>first element</li>
> > <li>second element</li>
> > <li>third element</li>
> > <li>fourth element</li>
> > </ul>
> > <li>
> >
> > ( end of repeat block )
> >
> >
> > </li>
> > </ul>
> >
> > I have the the following typoscript:
> >
> > <code>
> > temp.menu_v2 = HMENU
> > temp.menu_v2.entryLevel = 1
> > temp.menu_v2.1 = TMENU
> > temp.menu_v2.1 {
> > wrap = <ul>|</ul>
> > }
> >
> > temp.menu_v2.1.NO {
> > linkWrap = |*| <li><ul><li>|</li> || <li>|</li> || <li>|</li> || <li>|</li></ul></li>
> > }
> >
> > lib.globalnav < temp.menu_v2
> > </code>
> >
> > Now the problem is, if the number of menu items are exactly divisible by
> > 4 then it works perfectly, but if not then the final </ul></li> is missed
> > off.
> >
> > Any ideas on how I can do this? Is it possible with typoscript or would
> > it require an extension?
> >
>
> No extension required; it just requires another round of reading in
> the TSref [1]. Try this instead:
>
> temp.menu_v2 = HMENU
> temp.menu_v2 {
> entryLevel = 1
>
> 1 = TMENU
> 1 {
> wrap = <ul>|</ul>
>
> NO {
> wrapItemAndSub = <li>|</li>
> }
> }
> }
Perhaps I didn't explain myself above clearly enough. All the menu items
I am dealing with here are on the same level!
>
> -Christopher
>
> [1] http://typo3.org/documentation/document-library/doc_core_tsref/TMENUITEM/
> _______________________________________________
> Typo3-english mailing list
> Typo3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list