Log in Sign up

Generate a list of tags?

How can I create a page that just lists the tags that are being used? Is it possible for it to be auto-updated as well?

For reference I'm using a forked version of Essay 2.


3 years ago, 4 replies   Edit question

Yes, this is possible, using the {{#all_tags}} list. Here are a few steps:

1. Create the view

Create a new template view, perhaps called tags.html, to display your tags. Note you will need a template view, rather than a page, because to make this tag list dynamic will require using template code.

2. Insert the template code

Into your new view, perhaps called tags.html, add the following:

<!DOCTYPE html>
<html>
  {{> head}}
  <body>
    {{> header}}
    <div class="container archive">
    <h1>Tags</h1>
    {{#all_tags}}
    <a href="/tagged/{{slug}}">{{tag}}</a>
    <small>{{entries.length}} posts</small>
    <br>
    {{/all_tags}}  
    </div>
    {{> footer}}
  </body>
</html>

This includes some of the surrounding boilerplate to render the header and footer, from the Essay 2 template.

Please let me know if you have any questions about this, I'd be happy to go into greater detail about any of these steps.

Answered 3 years ago · Edit answer

This worked perfectly. Thank you!

Answered 3 years ago · Edit answer

Would this work for Blog Template as well?

Answered 3 years ago · Edit answer

Yes, it should! Please say if you run into any issues

Answered 3 years ago · Edit answer