Jul 19, 20187:51 AM - edited Jul 19, 20187:52 AM
Recognized Expert | Elite Partner
Custom blog topic page
SOLVE
@mateomm22 - Try this HUBL loop instead of the one you currently have. This will loop through all of the topics related to the current page's blog posts and match the slug to the current page's slug. Then you can use the name to display on your page.
{% if is_listing_view %}
{% for t in contents_tags %}
{% if t.slug == topic %}
{{t.name}}
{% endif %}
{% endfor %}
{% endif %}
If this answer helped, please, mark as solved 😄
tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.
Jul 19, 20187:51 AM - edited Jul 19, 20187:52 AM
Recognized Expert | Elite Partner
Custom blog topic page
SOLVE
@mateomm22 - Try this HUBL loop instead of the one you currently have. This will loop through all of the topics related to the current page's blog posts and match the slug to the current page's slug. Then you can use the name to display on your page.
{% if is_listing_view %}
{% for t in contents_tags %}
{% if t.slug == topic %}
{{t.name}}
{% endif %}
{% endfor %}
{% endif %}
If this answer helped, please, mark as solved 😄
tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.
Jul 19, 20183:59 AM - edited Jul 19, 20184:00 AM
HubSpot Employee
Custom blog topic page
SOLVE
Hey @mateomm22 it is possible to print the topic name on the topic page but it is a bit of a workaround. To do it, your code would need to be similar to the documentation here. It would look like this:
{{ page_meta.html_title|replace(' | ', '') }}
If we break down the code, what we're essentially doing is getting the blog topic page HTML title which is the blog listing page HTML <title> followed by a '|' followed by the topic name. Then we're using the replace filter to remove the blog listing <title> and '|' piece of things so that we are just left with the topic name. So all you have to essentially do is add the blog listing title before the '|' part in the code above. If my blog listing <title> was "My Blog 2018" my code would be:
{{ page_meta.html_title|replace('My Blog 2018 | ', '') }}
I'm not a developer so I could be wrong on this, but when I look at the developer info for one our posts, I'm seeing variables in the format 'topic_names' not 'topic.name'.