CMS Development

DM2
Membre

Filtering Blog articles and other pages

Résolue

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 Votes
2 Solutions acceptées
albertsg
Solution
Guide

Filtering Blog articles and other pages

Résolue

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


Book time with me

You can also connect with me on LinkedIn



Voir la solution dans l'envoi d'origine

DM2
Solution
Membre

Filtering Blog articles and other pages

Résolue

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.

Voir la solution dans l'envoi d'origine

0 Votes
6 Réponses
webdew
Guide | Partenaire solutions Diamond
Guide | Partenaire solutions Diamond

Filtering Blog articles and other pages

Résolue

Hi @DM2 ,

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

0 Votes
albertsg
Solution
Guide

Filtering Blog articles and other pages

Résolue

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


Book time with me

You can also connect with me on LinkedIn



Graham_USMC
Contributeur | Partenaire solutions
Contributeur | Partenaire solutions

Filtering Blog articles and other pages

Résolue

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

0 Votes
albertsg
Guide

Filtering Blog articles and other pages

Résolue

@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


Book time with me

You can also connect with me on LinkedIn



Graham_USMC
Contributeur | Partenaire solutions
Contributeur | Partenaire solutions

Filtering Blog articles and other pages

Résolue

Thank you very much - I appreciate the help greatly!

0 Votes
DM2
Solution
Membre

Filtering Blog articles and other pages

Résolue

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 Votes