How to display list of tags in ghost blog?

I am unable to display list of available tags in a sidebar, in ghost blog.

I am tag.hbs file with the below code.

 <header class="main-header tag-head {{#if tag.image}}" style="background-image: url({{tag.image}}){{else}}{{#if @blog.cover}}" style="background-image: url({{@blog.cover}}){{else}}no-cover{{/if}}{{/if}}">
    <nav class="main-nav overlay clearfix">
        <a class="back-button icon-arrow-left" href="{{@blog.url}}">Home</a>
    </nav>
    <div class="vertical">
        <div class="main-header-content inner">
            <h1 class="page-title">{{tag.name}}</h1>
            <h2 class="page-description">
                {{#if tag.description}}
                    {{tag.description}}
                {{else}}
                    A {{pagination.total}}-post collection
                {{/if}}
            </h2>
        </div>
    </div>
</header>

{{! The main content area on the homepage }}
<main class="content" role="main">
    <div class="container">
        <div class="row-fluid">
            <div class="col-md-12">
                {{! The tag below includes the post loop - partials/loop.hbs }}
                {{> "loop"}}
            </div>
        </div>
    </div>

</main>
{{> myfooter colour='ec-teal' inverse='true'}}

And this is how I am including it in my post.hbs file

<div class="col-md-4">
   <div class="row tags-row">
         <h3> TAGS </h3>
         {{#tag}}{{/tag}}
    </div>
</div>

Problem solved:

All I did was updated my code in post.hbs and changed {{#tag}}{{/tag}} to only {{tags}} and that resolved the issue.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.