Apologies for the potentially very dumb post but having browsed the forum and The almost Complete Guide to Constructing Menus, I’m still no closer to finding the answer I’m looking for. Being new to MODx (but impressed and keen to adopt it), it may be staring me in the face but I just can’t see it.
My simple content structure has site sections which appear as tabs along the top and then in a bar under the tabs a list of sub-sections under the active tab. The structure is simply like this:
> Home (Area 1)
> News (Area 1 Section a)
> Events (Area 1 Section b)
> Fundraising (Area 1 Section c)
> Media (Area 1 Section d)
> About NF (Area 2)
> What is NF? (Area 2 Section e)
> Other strep infections (Area 2 Section f)
> Coping with NF (Area 3)
> Preventing and treating NF (Area 4)
etc.
Visually, it outputs like this:
If someone clicks on the tab for Area 1, I want this tab to:
- have a different class to show that section is active
- show the content of the Area 1 landing page
- In the bar under the tabs, show links to the sections under that area
I have all of these working but to get the sections to display, I have to hard code the document ID of the parent tab into the bar display block.
The code for the tab block is:
[[Wayfinder? &startId=`0` &level=`1` &outerTpl=`navFirst` &rowTpl=`navFirstTab`]]
The code for the bar block is:
[[Wayfinder? &startId=`1` &level=`1` &outerTpl=`navSecond` &rowTpl=`navSecondRow`]]
How can I code this so that if I click on the tab for Area 1, I’ll see the bar showing Sections a, b and c and if I click on the tab for Area 2, I’ll see the bar showing Sections d, e and f.
If you can help me get this working, there is a second part where if you click on one of the Section links, how do you then keep the same visual effect showing the parent tab as active (effectively driving the navigation structure from the child level up rather than parent down) but also adding a class to the section as active.
Any help would be most appreciated, thanks.