CMS Development

Luon
Participant

Create a list of links to blog topics

SOLVE

Hi,

On my blog overview page i want to print a list of links to the blog topic pages.

Can someone please point me in the right direction?


Gr

Tim

1 Accepted solution
tjoyce
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Create a list of links to blog topics

SOLVE

@Luon - 

That code can be found in the documentation. If you add a custom module or raw html block to your template, or even drop the following code into the source view of a wysiwyg on your page editor, you should get the list of topics and their links. It's important to keep in mind that orphaned topics that don't belong to a blog post will not show up.

{{ blog_topics('default', 250) }}

{% set my_topics = blog_topics('default', 250) %}
<ul>
{% for item in my_topics %}
<li><a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item }}</a></li>
{% endfor %}
</ul>

If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

View solution in original post

2 Replies 2
tjoyce
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Create a list of links to blog topics

SOLVE

@Luon - 

That code can be found in the documentation. If you add a custom module or raw html block to your template, or even drop the following code into the source view of a wysiwyg on your page editor, you should get the list of topics and their links. It's important to keep in mind that orphaned topics that don't belong to a blog post will not show up.

{{ blog_topics('default', 250) }}

{% set my_topics = blog_topics('default', 250) %}
<ul>
{% for item in my_topics %}
<li><a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item }}</a></li>
{% endfor %}
</ul>

If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

Luon
Participant

Create a list of links to blog topics

SOLVE

Thank you very much!