We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Jul 21, 2020 9:47 AM
We have a blog concise.co.uk/insights. We would like to print out a heading for the listing pages which reflect the topic which has been chosen. So for example for the url https://www.concise.co.uk/insights/topic/backup-disaster-recovery the heading for that listing page would be the topic name which is Backup & Disaster Recovery.
Solved! Go to Solution.
Jul 22, 2020 7:09 AM - edited Jul 22, 2020 7:35 AM
Hi @GillBraysh, and thanks for the tag @sharonlicari.
This should do it. Put this in place of whichever title you want to replace, e.g. if you're replacing "Our perspective":
{% if topic %}
{% set my_tags = blog_tags('default', 250) %} {% for item in my_tags %} {% if topic == item.slug %} <h2>{{ item }}</h2> {% endif %} {% endfor %}
{% else %}
<h2>Our perspective</h2>
{% endif %}
Edit: there is actually an easier way of doing this.
{% if topic %} {% set topicName = page_meta.html_title|replace(group.html_title ~ ' | ', '') %} <h2>{{ topicName }}</h2>
{% else %}
<h2>Our perspective</h2> {% endif %}
Jul 22, 2020 7:09 AM - edited Jul 22, 2020 7:35 AM
Hi @GillBraysh, and thanks for the tag @sharonlicari.
This should do it. Put this in place of whichever title you want to replace, e.g. if you're replacing "Our perspective":
{% if topic %}
{% set my_tags = blog_tags('default', 250) %} {% for item in my_tags %} {% if topic == item.slug %} <h2>{{ item }}</h2> {% endif %} {% endfor %}
{% else %}
<h2>Our perspective</h2>
{% endif %}
Edit: there is actually an easier way of doing this.
{% if topic %} {% set topicName = page_meta.html_title|replace(group.html_title ~ ' | ', '') %} <h2>{{ topicName }}</h2>
{% else %}
<h2>Our perspective</h2> {% endif %}
Jun 30, 2021 12:11 PM
I did this and it works good on the first page of the listings, but on any further listing pages it ads the page number. Anyway to remove that?
Ie:
Page 1 H1= Business Growth
Page 2 H1= Business Growth (2)
Jul 22, 2020 6:40 AM
Hey @GillBraysh
Thank you for the information provided. I'll tag a few experts.
Hey @Kevin-C @piersg @Chris-M what would you advise in this case?
Thanks
Sharon
![]() | ¿Sabías que la Comunidad está disponible en Español? ¡Participa hoy en conversaciones en el idioma de tu preferencia,cambiando el idioma en tus configuraciones! Did you know that the Community is available in other languages? Join regional conversations by changing your language settings ! |