Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Homepage Tag list not contained – Mercury theme

  • #4192
    Avatar photo[anonymous]

    Hi, I have recently started with Publii, and I must say, its really a job well done.
    I am using the most recent version of Mercury (v2.2) with “mainTag” option, to better filter the posts in the home page. However, even with the “mainTag” option set on all my posts, the homepage displays all the tags that I used everywhere on the website.

    Do you know if it could be possible to contain the tags-list in the homepage to just ‘mainTags’. I have tried to edit index.hbs, but in vein. Could someone help me out here. Thank you!

    #4194
    Avatar photoBob

    The filter list always shows all tags, the difference is it can filter posts by all tags or only maintag what it’s very helpful if you tagged your posts with multiple tags but want to filter by the only one (the maintag).

    #4202
    Avatar photo[anonymous]

    Hey bob, Thats true. Its pretty useful feature. But I feel there could be an option to list just mainTags instead of all tags. From the index.hbs, I have attached a screen which I feel could be edited a little to make such change. I could evaluate so much, but I’m blank after that.

    {{#each tags}}
          <button class="filter__item" data-filter=".{{slug}}">{{name}}</button>
    {{/each}}
    
    
    #4204
    Avatar photoBob
    [anonymous] wrote:

    an option to list just mainTags instead of all tags

    Unfortunately, it is not possible this way.
    But I think you can try to use the getTags helper to achieve the desired effect

    #4205
    Avatar photo[anonymous]

    Thank you! I will check it out and post updates.

    #11642
    Avatar photo[anonymous]
    [anonymous] wrote:

    Thank you! I will check it out and post updates.

    Any updates?

    #11652
    Avatar photo[anonymous]

    I believe I tried it out, but could not achieve the desired functionality of just listing mainTags. At lease, you could manually add the Tags you wish to display, like Bob mentioned with getTags Helpers, but every time you add a new one, you’ll need to update it directly in the code. Hope this helps. I do not have the codebase with me, so I could not post any references

    #11656
    Avatar photo[anonymous]
    [anonymous] wrote:

    I believe I tried it out, but could not achieve the desired functionality of just listing mainTags. At lease, you could manually add the Tags you wish to display, like Bob mentioned with getTags Helpers, but every time you add a new one, you’ll need to update it directly in the code. Hope this helps. I do not have the codebase with me, so I could not post any references

    No worries! I asked because someone recently asked a similar question, and I found your post.

    It looks like someone created a custom helper, but I haven’t tested it yet: https://forum.getpublii.com/topic/get-posts-by-main-tag/

    Another user has (rightfully) highlighted how confusing the “Filter by Maintag” option is.

    #11772
    Avatar photo[anonymous]

    Good news: looks like this should be fixed for version v.0.45 https://github.com/GetPublii/Publii/issues/1329#issuecomment-1930943339

    Discussion continued here: https://github.com/GetPublii/Publii/discussions/1401