We are using a side stalk style navigation as below:
When one of the pages listed in the UL is current we want it to be hi-lighted (different colour) and then when the page the LI is current we want this to be hi-lighted in addition to the UL so the user gets a clear indication as to which section and page then page they are viewing.
Is there something missing in the code to do this, as I cant see how Matrx can add the relevant piece of code to the Active UL and LI (again this works very well in classic!)
This tells Matrix to print <li class="normal"> for normal (non-selected) items, <li class="current"> for the current page and <li class="hierarchy"> for parent pages of the current page. This allows you to highlight not just the current page, but the path to get to the current page as well.
Then use <MySource_PRINT var="settings.class" /> and <MySource_PRINT var="settings.style" />. Also note that settings.style will only print a value for the current item. The other two are blank, so it won't output anything for normal/hierarchy items.
Hi Avi
I have added the code into the design and I am seeing empty class tags being assigned, please see below code.
Could you explain how matrix determins what class to assign to the item (is it on the user click?), in the below code Taxis should be assigned a 'current' class and the rest 'normal'
I would need to see your parsefile and a small site map to determine why the class is empty. Essentially, Matrix paints "current" for the currently displayed assets (if it is in the menu), "hierarchy" for assets that are in the lineage of the currently painting asset and "normal" for everything else.
I'd like to be able to assign a class to the current item only – without "class normal", etc, on the other list items – which me as being somewhat more concise and elegant. Is there any way of achieving that?
Ah, thanks. But there's no way around needing something like <li class="<MySource_PRINT var='settings.class" />"> is there? So you'd still have an empty class on each list item in the menu. Yeah, I know, I'm hugely fussy about markup generation.