aquarium

Customer
When using an addon and going to that addons home page in the navigation, the selected indicator shows perfectly in any theme. But when putting up a page that is not, for example an inner page as a top nav item, the top indicator is not shown. For example, this does not show the selected indicator. But if you choose the forums or new selections, you'll see the selection indicator selected. Anyone have some insights into this behavior?

 
The answer is that it is not generating an "is-selected" tag on inner areas other than the root. This I am not sure how to fix and may be a Xenforo Bug.

<div class="p-navEl is-selected" data-has-children="true">

 
It's not really a XenForo bug. You're placing manual links into the navigation, which doesn't automatically translate into a selected state if you're on that page. If you had the general AMS link (Articles) in the navigation it would show as selected.

Forum nodes have an option that allows you to set the selected state:
1707598401304.png


But AMS would need something similar for this to work.

Normally I'd say you could use some manual CSS to make it "appear" to be selected:

Code:
[data-container-key="amsCategory-3"] .p-navEl-link[data-nav-id="xa_journal"]
{
.xf-publicNavSelected();
}

But this only works while you're browsing that specific category. It wouldn't work once you click on any article from those sub-categories.
 
Thanks - I'll look into it for that page or just remove the indicator altogether if there is no solution. I was hoping to have the tab stay there for the root and all subs of the entry point. Anyway, take a look at the same page in Chrome and in Firefox. It looks like the Page Assets (basic grid) break at the top, at least they do for me on a PC.
 
Actually... I forgot about this. Would probably work:

Edit template: xa_ams_category_view

Find:
Code:
<xf:description>{$category.description|raw}</xf:description>

Add below:

Code:
<xf:if is="$category.category_id =='3' OR $category.parent_category_id =='3'">
<xf:page option="section">xa_journal</xf:page>
</xf:if>

Pretty sure that will work for a "selected state"
 
Oh you are fiendishly clever. Seriously - who supports their work and customers like this?

It actually works for all the categories - both the main page and the internal categories but unfortunate not the articles themselves. I have to figure out which template is used for articles pages but i can just plug that code into all of them and an array of categories per parent category would result in the appropriate selected state.

I was about to ask if we could just turn off the selected state indicator entirely and keep a consistent look and feel, which would be a useful option for some of these templates.

Seriously.... seriously... thank you. Brilliant.
 
This should work on the Article view:

Template: xa_ams_item_view

Find:
Code:
<xf:if is="!$item.isSearchEngineIndexable()">
    <xf:head option="metaNoindex"><meta name="robots" content="noindex" /></xf:head>
</xf:if>

Add the same edit after:

Code:
<xf:if is="$category.category_id =='3' OR $category.parent_category_id =='3'">
<xf:page option="section">xa_journal</xf:page>
</xf:if>

As for a thread view if there is an attached one... I don't know if it would work there.
 
Last edited:

Pre-Sale Questions

If you have any questions or concerns you want to ask before you make a purchase don't hesitate to use one of our multiple support channels for your convenience.

Back