CMS Development

DM2
Member

Filtering Blog articles and other pages

SOLVE

hi there

 

I am looking to create a summary page that will contain links to blog articles and also links to other website pages. 

 

I know how to filter blog articles by tag and I would like to apply the same principle to other (non blog) website pages. Is it possible to tag other pages in some way?

 

Essentially I want to be able to select a tag and display filtered content for both blog articles and other pages. Perhaps I could apply a notional 'tag' to the website pages via a custom module and access that variable in the summary page? 

 

Would be very grateful for any steer here!😀

0 Upvotes
2 Accepted solutions
albertsg
Solution
Guide

Filtering Blog articles and other pages

SOLVE

Hello @DM2

 

I believe a custom module would be the best solution in this case. We did a similar thing and basically using a custom module with a dropdown with different options allowed us to filter posts/pages according to what we needed/wanted.

All you will need to do is access the module property of your page/blog and use that variable while filtering your content.

 

Hope it helps!

 

 



Did my answer help you? Mark it as a solution

You also connect with me on LinkedIn or Twitter

View solution in original post

DM2
Solution
Member

Filtering Blog articles and other pages

SOLVE

Thank you, yes you're right. I have started to achieve this by using a custom module that adds in the non blog content - and through a choice field for each item - applies a class / or classes that are in line with the blog tags. divs with classes applied can then be filtered accordingly.

 

I think the concept of 'page tagging' though could be a really useful development.

View solution in original post

0 Upvotes
6 Replies 6
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Filtering Blog articles and other pages

SOLVE

Hi @DM2 ,

Try teh below code. It will work for blogs only:

0 Upvotes
albertsg
Solution
Guide

Filtering Blog articles and other pages

SOLVE

Hello @DM2

 

I believe a custom module would be the best solution in this case. We did a similar thing and basically using a custom module with a dropdown with different options allowed us to filter posts/pages according to what we needed/wanted.

All you will need to do is access the module property of your page/blog and use that variable while filtering your content.

 

Hope it helps!

 

 



Did my answer help you? Mark it as a solution

You also connect with me on LinkedIn or Twitter

Graham_USMC
Contributor | Partner
Contributor | Partner

Filtering Blog articles and other pages

SOLVE

Is there a link to your "similar thing" or a thread about this solution? 

0 Upvotes
albertsg
Guide

Filtering Blog articles and other pages

SOLVE

@Graham_USMC in the following article you can see how to access a blog post module (and its variables) from another template (a listing page for example). While the article talks about something else, this implementation is used so you can get the idea and how to implement it: https://dev.to/albertsg/having-multiple-blog-post-templates-in-hubspot-10i1 



Did my answer help you? Mark it as a solution

You also connect with me on LinkedIn or Twitter

Graham_USMC
Contributor | Partner
Contributor | Partner

Filtering Blog articles and other pages

SOLVE

Thank you very much - I appreciate the help greatly!

0 Upvotes
DM2
Solution
Member

Filtering Blog articles and other pages

SOLVE

Thank you, yes you're right. I have started to achieve this by using a custom module that adds in the non blog content - and through a choice field for each item - applies a class / or classes that are in line with the blog tags. divs with classes applied can then be filtered accordingly.

 

I think the concept of 'page tagging' though could be a really useful development.

0 Upvotes