Custom Navigation ignoring a tag

LordMisha
LordMisha

SO I have several campaigns now with some custom navigation links that all work fine. So my question, is it possible to create a custom navigation for character page that IGNORES one filter and shows all of the rest?

So I have a game with Pathfinder, D&D, AD&D, and no system for example.

The link for pathfinder character page:

    <li class='characters active-target'>

      <a href='/characters?filters=tag_pathfinder&expand_filters=false'>

        <span class='nav-icon icon op-icon-characters'></span><span class='nav-text'>&nbsp;Pathfinder Characters</span>

      </a>

    </li>

So now I want the default character page to show the no system, D&D and AD&D but NOT the Pathfinder. So a version of the above that essentially show everything BUT the Pathfinder. So the page would see the Pathfinder tag and NOT show those characters.

    <li class='characters active-target'>

      <a href='/characters?filters=tag_pathfinder&expand_filters=false' BUT INSTEAD FILTERS OUT THE PATHFINDER ONLY>

        <span class='nav-icon icon op-icon-characters'></span><span class='nav-text'>&nbsp;Pathfinder Characters</span>

      </a>

    </li>

 

I hope I am making sense, is it getting late in the evening for this old grognard.

Comments

  • vadercomplex
    vadercomplex
    Posts: 267

    I'll have the team check it out and get back to you, friend! @LordMisha

    Obsidian Portal Support Druid | [email protected]

  • Abersade
    Abersade
    Posts: 629

    You can try something like this:



                   .character-index.campaign-public-layout .content-list:not([data-filter=".tag-pathfinder"]) .content-list-item {YOUR CSS CHANGES HERE;}

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 629

    That's assuming that the tag that you want to specifically exclude is pathfinder

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 629

    Hold on, that's for targeting by tag, not filtering by tag. Let me try again.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 629

    Ah, interesting.

    Try <div class="content-list" data-filter=":not(.tag-pathfinder)">, per the help.obsidianportal.com/article/192-customizing-the-campaign-characters-page guide.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • LordMisha
    LordMisha
    Posts: 31 edited September 2025

    Hmm, that almost solves the problem. To work if you have standard Characters page yes, use the above like this:

    <div class="secondary-heading">Player Characters</div>

    <div class="content-list" data-filter=".pc:not(.tag-pathfinder)">

    <ul class="large-block-grid-2 small-block-grid-1"></ul>

    </div>

    <div class="secondary-heading">Non-Player Characters</div>

    <div class="content-list" data-filter=".npc:not(.tag-pathfinder)">

    <ul class="large-block-grid-2 small-block-grid-1"></ul>

    </div>

     

    The problem is I am using the Custom Navigation Menu option so I have two different pages for characters listing. Let's say a Pathfinder Characters Page and a Non-Pathfinder Characters page (the original page).

    <li class='characters active-target'>

    <a href='/characters'>

    <span class='nav-icon icon op-icon-characters'></span><span class='nav-text'>&nbsp;Characters</span>

    </a>

    </li>

    AND

    <li class='characters active-target'>

    <a href='/characters?filters=tag_pathfinder&expand_filters=false'>

    <span class='nav-icon icon op-icon-characters'></span><span class='nav-text'>&nbsp;Pathfinder Characters</span>

    </a>

    </li>

    The above code hides the Pathfinder characters on BOTH pages. So the trick is to find a way to add the :not option to the code for the actual Custom Menus. I playing around with syntax to try and add that :not into:

    <li class='characters active-target'>

    <a href='/characters'> <a href='/characters?filters=:not(tag_pathfinder&expand_filters=false)'> with the:not added somehow. This example doesn't work mind you.

    <span class='nav-icon icon op-icon-characters'></span><span class='nav-text'>&nbsp;Characters</span>

    </a>

    </li>

    But, the above suggestion did solve my problem on another campaign with just the standard Character List page, so that is something, thanks!

    It was interesting to learn that the Custom Characters Layout will rule across all Custom Menu created character pages. Didn't consider that. If can be coded to work on one specific character page then the suggested solution would work as well.
    Post edited by LordMisha on
  • LordMisha
    LordMisha
    Posts: 31

    Should have included this in the above response. Here is the link to each of the Custom Menu Character pages with that added Character Menu option. You can see the Pathfinder characters hidden on the original page and the Pathfinders Character page is now completely blank :)

    https://agatheringofheroes.obsidianportal.com/characters

    Pathfinder Character Page:

    https://agatheringofheroes.obsidianportal.com/characters?filters=tag_pathfinder

  • Abersade
    Abersade
    Posts: 629

    Ah, yeah, makes sense why that change applies to both pages; there aren't two separate pages, just two links (one filtered) to the same page.

    I know of a workaround, but I'll keep digging before I suggest it since it doesn't actually answer your question.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 629

    The more that I look into this the more uncertain I become that it's possible to exclude one filter while including the rest, unless you want to code them ALL in to the URL. Which, to be fair, would work; you would just have to adjust it as tags were added to the game. Unfortunately for your game, the only system that you specifically tagged for is Pathfinder, so that doesn't work as you currently have your tags designed.

    You need either a single tag to look for, or a list of tags to look for, instead of a tag to NOT look for since the query is inherently an additive construct. I see two ways to accomplish this.

    1. Tag all of your non-Pathfinder characters with a tag that can be used as the target of the filter, the tag doesn't have to be relevant or make sense at all since you can just hide it via CSS. This was the workaround I was thinking of earlier. Of the two solutions, this one is the easiest to implement and maintain but is also the one I personally wouldn't go with.

    2. Tag all of your characters with a system, like you did with the Pathfinder characters, then build the url query filter string based off of the systems that you want to display. Example: say you have Pathfinder, DND, and WoD as your systems; your query that excludes Pathfinder would read something like /characters?filters=tag_DND%2Ctag_WoD. The drawback to this method is that you have to tag every character with the appropriate system tag AND if you add any system tags in the future the URL would also need to be updated.

    Disclaimer: Maybe there is a way to do it via tag based exclusion like you are proposing, but everything I looked at seems to indicate that this isn't going to work. Then again, I'm not a web developer so I could totally be wrong. There is a query parameter called NE (as in, not equal) that looked like it should work, but I couldn't get it do much of anything in my testing. Every other parameter that I looked into was additive in nature so you couldn't use it to say something like "every tag except this one".

    Hopefully that makes sense.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 629

    I looked into this more because not being able to get it working was bugging me. After screwing around with it further I still have no method to recommend to you, aside from what I already posted previously. The tag filters are both additive and cumulative, which makes me think that any variation of ne isn't going to work. Even if it did work, you'd still have an issue.

    Explanation Scenario: We select your first tag, let's say it's human, there are four humans on your character page currently so four results are displayed. Now we want to select the elves as well, but they are grayed out because these selections are cumulative, so it acts as a boolean AND operator instead of an OR operator. If we select the elves at this point, your four results get stripped down to none. That clearly isn't going to work, and by extension that indicates any attempt to use more than one filter is likely to be a problem unless you want to select an existing category and then narrow down the results displayed as they get more specific. Humans and Outriders? 1 result. Humans but not Pathfinder? invalid query, resulting in either an error from the backend, no change whatsoever from the existing display, or my personal favorite: all results just vanish; all based on how the query is typed in.

    I tried, I really did. Your best bet in my opinion is to create a system tag for each system and use that.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 629

    I did have a whole suggestion typed out about a way for the OP team to address this, but as I was typing it out I realized that it relied on you creating a system tag anyways so the use case was basically nil.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • vadercomplex
    vadercomplex
    Posts: 267

    @LordMisha MY SINCEREST APOLOGIES! I had no idea I never followed up on this! I re-submitted the ticket, and will be sure to let you know when I hear back! 

    Obsidian Portal Support Druid | [email protected]

  • vadercomplex
    vadercomplex
    Posts: 267

    Hey friend! @LordMisha

    We heard back from the team:

    I think this is something that can only be done with Custom JavaScript. Here’s a comment I made a while ago that explains how they could do it:

    https://forums.obsidianportal.com/discussion/comment/47481/#Comment_47481

    Please use that link to find the code information!

    Here's a second idea that doesn't require Custom Javascript:

    When you use the “filter” query string parameter, it adds a body level class to the page. So, for example, when you go to:

    https://agatheringofheroes.obsidianportal.com/characters?filters=tag_blades

    If you View Source, on the body, you’ll see a class of “filter-tag-blades”.

    So, you can use that to add a class to the body with a “fake” filter like:

    https://agatheringofheroes.obsidianportal.com/characters?filters=hide-pathfinder

    That will add a class of “filter-hide-pathfinder” to the body of the page.

    Then, in your Custom CSS, you can do something like:

    .filter-hide-pathfinder .content-list-item-container.tag-pathfinder {

    display: none;

    }

    So, then when you visit that page with that filter, the pathfinder tagged Characters will all be hidden.

     

    Please let us know if there's more we can help with! Let us know how it goes :)  

    Obsidian Portal Support Druid | [email protected]

  • Abersade
    Abersade
    Posts: 629

    Huh. Never would have thought of that approach. Neat. That is fairly close to the suggestion I was going to make actually, but already implemented.

    Spiffy.

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

Sign In or Register to comment.

September 2026
City of Shadows

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions