This entry is a bit tech-savvy, so it will be focused on developers.

If you ever wondered if it was possible to have different tags level (what you may know as Categories and tags from WordPress), wonder no more!

Yes! you can have categories and topics or tags in Hubspot.

Steps to have categories and tags in Hubspot:

  1. Use a custom internal prefix to split between categories and tags. I normally use the dollar sign $, because Hubspot removes it from the slug. So it is 100% transparent for the visitor.
  2. Create your new sub-tags and attach them to at least one blog post (or it won't show up)
  3. Edit your blog listing template as follows in all the places where you usually display the tag listing, keep in mind these typical places: blog index listing page, blog tag listing page, any custom module that may display posts such related posts, popular posts, etc.

{% for tag in post.tag_list %}
{% if not tag.name is string_startingwith "$" %}
    {{ '<a href="%d" class="tag-link">%d</a>'|format(blog_tag_url(parent_blog.id,tag.slug), tag.name) }}{{ " ," if not loop.last }}
{% endif %}
{% endfor %}

Your code may look different, but the idea is that you won't display the tags starting with $ therefore we use the if conditional to avoid printing those sub-tags.

You need to repeat this process for each template and module where you display the tags attached to each post.

Typical places:

- [Template] Blog index listing page

- [Template] Blog tag listing page

- [Template] Blog author listing page

- [Module] Related posts

- [Module] Most popular posts 

That's all folks!