How to Add a Dynamic Tag Menu to your Blog


Note: The API is currently in beta. Some things in the post may change as Ghost solidifies how the API will function.

If you want to have a menu that lists all of the tags on your blog with links to the tag pages, here is how you can do that:

  1. Make sure you have the API turned on in the Labs section of your Ghost admin.

  2. Head to your theme files and find where you want to put the menu. We are going to add it to the side menu of the default Casper theme, so we will be putting the menu in partials/navigation.hbs.

  3. We are going to be using the {{get}} helper and should look something like this:

    {{get "tags" limit="all"}}
        {{#foreach tags}}
            //your menu here
        {{/foreach}}
    {{/get}}
    

    Here is the code for the menu we are adding to Casper:

  4. Restart Ghost and you should see your tag menu!

Let us know if you have any questions in the comments below!

4. Restart Ghost and you should see your tag menu! Let us know if you have any questions in the comments below!