XF 2.1 Active status in custom Nav Links don't work

ChrisTERiS

Well-known member
Hello,

I've added some Nav Links using Public Navigation, but even if the links work fine, the "Active" status does not works even if the Navigation ID is unique. What can be the problem? As I can see in other (native) links, there is something like {{ link('forums') }}, while I'm using full URL. Maybe I need to replace the domain with a variable, or what?

Thank you
Chris
 
Good day @ChrisTERiS, the only thing I can think of is that the route must be set and the section context field must contain the name of the parent tab, or the tab itself if the tab is the only link. Example from one of my add-ons: Development -> Routes -> members/roles -> Section context -> members This will highlight the Members tab when that link is selected.
 
My understand is that you need to reference the navigation id within the page you are linking to

For example I created a navigation with ID=info

I added some help pages and at the top of each of those I have <xf:page option="section">info</xf:page>

This then causes the Info tab to be active
 
Last edited:
@Lawrence @Mr Lucky
Thank you both for your prompt attention. Actually the 2 links that I've problems are links to XFRM categories. eg
1591542047152.webp

PS: Here is with a custom theme, but even with the default the nav tab is not active.

What I'm doing wrong?

Chris
 
PS: Here is with a custom theme, but even with the default the nav tab is not active.

What I'm doing wrong?
Did you try what I suggested though with the nav ID option code?

I’m no expert but I assume you’d add it to category template and then use a conditional for the specific category.
 
If you bring back your Resources tab, then it would be active when you click that link you posted, as it is using the resource route.

Try what Mr Lucky suggestions, to set the context in the template if the resource category id matches your whmcs-modules id.
 
Actually I post wrong link. That link to Resources category, most probably should work, as there is option to do it with Resources Categories in Page criteria. Unfortunately there is nothing for XF Product Manager.

But I wonder why this can't be automatic from the system. There is a link here it's easy to get it with a simple PHP function and activate the relevant menu item.
 
Top Bottom