[Typo3] HMENU / TMENU wrap problem

John Greene john at grumpet.net
Fri May 27 22:32:52 CEST 2005


> 
> Hi,
> 
> > Hello,
> > 
<snip>
> > 
> > Which works... sort of.  What doesn't work as I expect is:
> >         allWrap = <div id=" | "> | </div>
> 
> <snip>
> 
> No, I wouldn't expect that to work. First of all, the wrap is
> expecting only a single pipe character ("|"). But in any case the code
> above still would not do what you expect (i.e. even if it were
> 'allWrap = <div>|</div>').
> 
> If I read your 'wanted' code right, you'd like to wrap the *entire*
> menu, but what you have above will wrap only items in the top menu.
> Probably what you want is something like:
> 
> temp.menu_3 = HMENU
> temp.menu_3.stdWrap.dataWrap = <div id="{field:uid}">|</div>
> 
> ...which wraps the whole HMENU item. Your code above tries to wrap
> only temp.menu_3.1 - which , as mentioned, is only one item of the
> menu. If that *was* what you wanted to do, you'll need to alter your
> code to read something like:
> 
> temp.menu_3.1.wrap.dataWrap = <div id="{field:uid}">|</div> 
> 
> ...though this would, or course be invalid CSS (multiple ids not
> allowed). The 'allWrap' property you used is a property of TMENUITEM
> [1], so it you can't simply move it up to temp.menu_3.1 or temp.menu_3
> to fix the problem
> 
> See http://typo3.org/documentation/document-library/doc_core_tsref/stdWrap/
> and http://typo3.org/documentation/document-library/doc_core_tsref/Datatype_reference/
> for more stdWrap and datatype fun :)
> 
> 
> -Christopher

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?

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:

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



More information about the TYPO3-english mailing list