[Typo3] TMENU question

JoH info at cybercraft.de
Fri Jul 29 19:40:43 CEST 2005


> I am trying to do something like this:
>
> temp.menu.10 = HMENU
> temp.menu.10.1 = TMENU
> temp.menu.10.1 {
>      ... blah blah
> }
>
> temp.menu.10.2 = TMENU
> temp.menu.10.2 {
>      wrap.dataWrap = <ul id="{field:pid}">|</ul>  // this isn't
>      working NO = blah blah..
> }
>
> I am trying to mark the second level <ul> with the ID of its parent,
> for later use in javascript.
>
> <ul>
>     <li><a href="blah">category</a>      <-- temp.menu.10.1, the uid
> of this menu item is 4
>       <ul id="4">                    <-- temp.menu.10.2, the pid of
> this menu item is 4, inserted here by dataWrap?
>          <li><a href="item">item</a></li>
>      </ul>
>     </li>
> </ul>
>
> Reading back in the list, it appears that the wrap property of TMENU
> has the dataWrap property, but its not working for me..?

Where did you read that? - wrap is just a simple wrap with no additional
stdWrap properties.
What you are looking for is wrapItemAndSub.
Together with subst_elementUid it will give you the desired result:

temp.mymenu = HMENU
temp.mymenu {
    wrap = < div class="mymenu"><ul>|</ul></div>
    1 = TMENU
    1 {
        expAll = 1
        NO = 1
        NO {
            wrap = <li class="no">|</li>
        }
        IFSUB = 1
        IFSUB {
            subst_elemenUid = 1
            wrapItemAndSub = <li><ul id="element{elementUid}">|</ul></li>
        }
    }
    2 < .1
    3 < .1
}

Not tested but should be working!

Joey





More information about the TYPO3-english mailing list