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.

How to add custom tag template?

  • #8980
    Avatar photo[anonymous]

    Hi!

    In the Tags section, there’s an option under “Other options” to select a Custom template. It’s currently greyed out and says “not available in your theme”. How do I create them? I’m already familiar with creating custom post templates, but couldn’t find much documentation for tags.

    #8981
    Avatar photo[anonymous]
    #8982
    Avatar photo[anonymous]

    Hi Candide,

    I found these in the old “Starter” theme (https://github.com/GetPublii/theme-Starter) where you can declare custom tag and author templates in the config.json file.

    "authorTemplates": {
        "alternative": "1 column layout"
    },
    "tagTemplates": {
        "alternative": "1 column layout"
    },

    Then create the respective author-alternative.hbs and tag-alternative.hbs files.

    Edit: I just searched the Developer Documentation and see it being mentioned. 🙂
    https://getpublii.com/dev/how-to-create-custom-templates/

    #8983
    Avatar photo[anonymous]

    Thanks shaun2k! This is exactly what I was looking for.