[Typo3] HMENU / TMENU wrap problem

Christopher bedlamhotel at gmail.com
Fri May 27 22:58:19 CEST 2005


Hi,

Comments inline.


On 5/27/05, John Greene <john at grumpet.net> wrote:

> Hi Christopher,
> 
> Sorry for being unclear.  What I want is for each level-1 menu item to be wrapped in
> <div></div>, and for each level-2 item to be a list of linked titles within it seperated
> by <br /> within the <div> blocks.  The code sample above actually comes close to this,
> it just won't add the </div>s.
> 
> I had a feeling i couldn't add the pipe token more than once - is there a workaround for
> that?


Yep, as mentioned, it's 'dataWrap' in certain circumstances. Check my
previous post for doc references.


> Here is the output, but with proper indenting:
> 
> <div id="menu_3">
> 
>         <div id="16Menu">
>                 <a href="index.php?id=17">Products Overview</a><br />
>                 <a href="index.php?id=18">Products by Application</a><br />
>                 <a href="index.php?id=19">Products by Name</a><br />
>                 <a href="index.php?id=20">Products by Type</a><br />
>         <div id="21Menu">
>                 <a href="index.php?id=22">Support</a><br />
>                 <a href="index.php?id=23">Services</a><br />
>                 <a href="index.php?id=24">Training & Certification</a><br />
>         <div id="37Menu">
>                 <a href="index.php?id=43">Company Overview</a><br />
>                 <a href="index.php?id=42">Management & Board</a><br />
>                 <a href="index.php?id=41">Worldwide Locations</a><br />
>                 <a href="index.php?id=40">Careers</a><br />
>                 <a href="index.php?id=39">Newsroom</a><br />
>                 <a href="index.php?id=38">Events</a><br />
>         <div id="44Menu">
>                 <a href="index.php?id=46">Contact</a><br />
>                 <a href="index.php?id=45">Worldwide Contacts</a><br />
> 
> </div>
> 
> Again, all I want to do is close the <div> for 16Menu, 21Menu, 37Menu, 44Menu.  And
> here's the code that gives me the above:


Thanks for the indents :) My first question is 'why use the page ids?'
Depending on what you're trying to accomplish, you may be adopting a
more difficult strategy than is strictly necessary.


> temp.menu_3 = HMENU
> temp.menu_3.1 = TMENU
> temp.menu_3.1.expAll = 1
> temp.menu_3.1.NO {
>    doNotLinkIt = 1
>    stdWrap.field = field:uid
>    before.data = field:uid
>    allWrap = <div id=" | ">
>    after = Menu
> }
> ACT=1
> 
> temp.menu_3.2 = TMENU
> temp.menu_3.2.noBlur = 1
> temp.menu_3.2.NO {
>    after.wrap = <br />
> }
> ACT=1


As mentioned before, 'allWrap' is a property of tmenuITEMs, not
TMENUs. You need to use the TMENU property 'wrap', and you need to
apply it to temp.menu_3.2, NOT to temp.menu_3.2.NO - this controls the
wrap of the individual items in their normal state. As I mentioned,
you probably need something similar to:


temp.menu_3.2.wrap.dataWrap = <div id="{field:uid}">|</div> [you might
also use 'insertData'; see TSref for details]


For more on how H/T/GMENUs work, you may want to play with the
examples in the TS By Example manual [1].


-Christopher

[1] http://typo3.org/documentation/document-library/doc_core_tsbyex/HMENU/



More information about the TYPO3-english mailing list