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 a tag to a post?

  • #7663
    Avatar photo[anonymous]

    Dear all,

    I am new to Publii and have just installed it in my Win10 PC.

    I have created some tags, e.g. tag1, tag2, tag3

    I wonder how to add a tag to my newly created post?

    Thanks for any kinds of help!

    #7664
    Avatar photoBob

    While editing a post, click the gear icon in the upper right corner. Then you will see all the post options including tags.

    screenshot-2022-06-29-at-07.41.54

    #7667
    Avatar photo[anonymous]

    Oh!
    Thanks Bob for your comment!

    #7668
    Avatar photo[anonymous]

    Dear Bob,

    If I want to list all posts with the same tag, say “tag1”, in a post, how to do?

    Thanks!

    #7669
    Avatar photoBob
    #7670
    Avatar photo[anonymous]

    Dear Bob,

    It looks quite complicated to me as I am not a coder.
    However, I will try my best to make it.

    with reference to:
    https://getpublii.com/dev/create-post-list-from-specific-tags/

    I am using the “taste” theme:
    (a) I have checked that “createContentStructure” has been enable by default ( “createContentStructure”: true, )
    in the config.json file:

    C:\Users\user1\OneDrive\Documents\Publii\themes\taste\config.json

    (b) Then, in the “taste” theme folder, I have created the helpers.js file (it does not exists in the theme folder) with the code as specified:

    C:\Users\user1\OneDrive\Documents\Publii\themes\taste\helpers.js

    (c) Edit the post.habs file:

    C:\Users\user1\OneDrive\Documents\Publii\themes\taste\post.habs

    -> In line 80, I find the code  {{{text}}}   and change it to   {{{parseShortcode text}}}

    (d) Finally I created a post with name “SSP”, add it to a sub-menu, but it is what it is, pls. see the screen capture attached:
    create-a-post-list-from-a-specific-tag

    What’s wrong?

    #7673
    Avatar photoBob

    You are in the wrong location. Apply the changes here: Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME

    To preserve your custom code and prevent it being overwritten the next time the theme is updated, please ensure that you have created override files; these are, essentially, copies of the existing theme files that are stored separately from the main theme fileshttps://getpublii.com/dev/theme-overrides/