Custom relative tag filter on the nav bar

Facing that problem now. I’d love to have an “FAQ” tag which users can filter by, simply by clicking FAQ at the top of the nav bar. To fix this, it looks like the category id needs to be fetched and then included in the url.

@nolo Did you manage to get any further with this?

2 Likes

Yes, @Ahmed_Gagan did a custom component: GitHub - Ahmedgagan/discourse-nav-tag-links
Could try this out and dm me with feedback. One thing that’s not ideal yet is that you can select the tag from the custom link. But you can’t de-select it by clicking again. Users would need to de-select from the tag drop-down, which is likely not that intuitive.

1 Like

I see exactly what you mean. Even when I click latest after clicking FAQ, the faq tag is included in the “latest” url.

JS isn’t my native language, but I might dig around at some point and see if I can find something.

1 Like

After thinking about alternative ways to solve this problem, I realised one solution could be to include a “reset” attribute in the list. In this example, I called it “Everything”, but you could call it All, or Clear – whatever makes sense

Click FAQ to show only FAQs

Click everything to reset

In config

image

The main problem is that when you have a tag such as faq enabled, then it is appended to the url for latest automatically. The only way I can think of quickly solving this is to add another button to clear the tags

1 Like

I think an intuitive experience would be:

  • user is in a category and selects FAQs
  • FAQ topics for that category are listed and FAQs filter is hightlighted
  • user clicks highlighted filter again to undo the selection and all topics are shown again in this category

OR:

  • whatever next action the user chooses, it undoes the tag filter. so it’s just a one-time selection that brings up a specific list in a category
1 Like

Agreed. As a user I expect this filter to be undone as soon as I click another link or header.

My current solution is to just have a Category Sidebar, which at least creates a different expectation as a user.
image

I guess if the FAQs button in this case could be more distinct it might be more intuitive? Something which says “This is a filter that you toggle on or off”.

Perhaps even some combination of the two? A sidebar with radio icons that lets you simply toggle on and off multiple tags as filters?