I’m trying to make a three part menu (see attached image). I’ve got the basics going strong, but the problem is that as the "Level 3+"-menu part expands the footer doesn’t move down, thus the "Level 3+"-menu starts to overlap the footer.
It does that because to position that part of the menu I’ve had to use position:absolute, or else the "Level 2"-menu part looks all messed up.
Any suggestions? I’m using WayFinder Beta2, btw.
The only suggestion I’ve come up with is to use &level=`2` for the two horizontal menu parts and make a second call to WayFinder for "Level 3+", but how could I make it so that that call uses the active element from Level 2 as startitem? If you understand what I mean...
Maybe I should’ve put this under the wayfinder topic, but I think the solution will be independent from the menusystem.
/Anders
-
MODX Staff
- 12,272 Posts
What determines how is Menu Level 3 appears?
If it’s by actually being on a page or in a section, then it’s just a second Wayfinder call with [[UltimateParent]] as the startID (or something similar).
If it’s by hovering the top two menu items, then you need to wrap the entire menu in a relatively positioned DIV, then absolutely position each submenu.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
It’s not by hovering, but by clicking in the second menu that the third menu appears.
If I create a relatively positioned div that the whole menu resides in, will the absolutely positioned elements inside that div make the div "expand to fit"?
-
MODX Staff
- 12,272 Posts
No they won’t. Since the third menu is based on another menu selection, then your best bet is to have two calls, and to set up the startId to be the parent doc. I’m guessing each menu item in the third menu is a child of the same folder.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Yeah, they are all children of the selection in level 2. How do I specify which parent the level 3+ menu will use? Something like &startId=`level2.here` (I know that won’t work, but as an example).
-
MODX Staff
- 12,272 Posts
Check out the [[UltimateParent]] snippet. It should be able to do what you need:
[[Wayfinder?startId=`[!UltimateParent!]` ... ]]
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Thanks. I’ll check it out.
And use the &top parameter in ultimateparent snippet if the level2 link is not in site root. Also, if you have problems running the snippet, look at the support forums..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."