Hi
Been trying to figure this one out but can't. I am using Wayfinder in Evolution and I need to create what is basically a standard left hand navigation. Trouble is the way the tree structure is (and needs to be according to a previous dev) means I need to ignore 1 level of structure and display it on the front-end as if it wasn't there. So in the tree I have
item 1
-sublevel item 1
-- sublevel item 1 child 1
-- sublevel item 1 child 2
item 2
- sublevel item 2
-- sublevel item 2 child 1
-- sublevel item 2 child 2
On the front-end, if I select item 1, I would like to see
item 1
- sublevel item 1 child 1
- sublevel item 1 child 2
item 2
if I select item 2, I'd like to see
item 1
item 2
- sublevel item 2 child 1
- sublevel item 2 child 2
This means I need to basically ignore the 'sublevel item X' items.
I have tried hiding sublevel item from menu, but that means none of the children get picked up. I have tried exlcuding the items, same problem, no children.
Anyone got in idea? the 'sublevel item X' have all got the same template which is different from anything else. AFAIK there is no 'ignore template' option in Wayfinder?
Thanks for your help!
-
☆ A M B ☆
- 24,524 Posts
Use a Template Variable for the startId value. The TV's default value should be @INHERIT. Now, for each sublevel parent (whose children you want in the menu), edit the TV and put in its own resource ID. Its children will inherit that value, so their Wayfinder calls will have that ID as their startId value.
Hi,
Thanks for the quick reply, but that doesn't work - it means I loose the other items of the same level. following the example, this would only give me
- sublevel item 2 child 1
- sublevel item 2 child 2
But I need it to be if I select item 1
item 1
- sublevel item 1 child 1
- sublevel item 1 child 2
item 2
Or am i missing something here?
-
☆ A M B ☆
- 24,524 Posts
Ah. Sorry, I misunderstood what you wanted. Have you tried the &hideSubMenus=`1` property? That will hide all submenus except for those belonging to the page you've selected.
hi @sottwell, yeah, sorry, have tried the &hideSubMenus=`1` property but it doesn't work as I need to show the submenu items of the submenu, thereby skipping 1 level
@ottogal: thank you for the suggestion, I did think I may nee to do some snippet call to make this happen but even then wasn't sure how I would go about it. I will give your suggestion a whirl and get back here
Sorry, I overlooked you're using Evo.
To replace the non existent wf.level parameter you can use an own snippet which returns the level. I'm searching for an example and will tell you when I find it.
Thanks for that. A few things I have problems with, maybe you can help
firstly, I think it should say $output, not $input?
Using [+wf.docid:getLevel+] does give me 0, so I've changed it to
[+phx:input=`[+wf.docid+]`:getLevel+] which seems to give me the right levels.
One thing I don't understand is that it only works if I put this in the innerRow chunk
<li>[+wf.wrapper+]</li>
[+phx:input=`[+wf.docid+]`:getLevel:is=`2`:then=``:else=`<li><a title="[+wf.title+]" href="[+wf.link+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>`+]
If I just have
[+phx:input=`[+wf.docid+]`:getLevel:is=`2`:then=``:else=`<li><a title="[+wf.title+]" href="[+wf.link+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>`+]
I don't get anything back, I need to add <li>[+wf.wrapper+]</li>. Do you know why that would be? Confused