CMS Development

JVallejo7
Contributor

Custom filter by tag to blog listing

SOLVE

I have a blog listing with the title and the summary of each post. When a user selects a tag (test, events), the blog listing needs to change with the selected tag filter by the user (like AJAX behavior, but Hubspot doesn't allow AJAX).

 

JVallejo7_1-1651737141199.png

With the content-search API I don't have access to summary post, only the title

Any ideas? how can I do this in HubSpot ?
Something like this:

{% set tag_posts = blog_recent_tag_posts('default', ['tag selected by user', 'tag selected by user', 'tag selected by user'], 100) %}

The request variables don´t be useful because I will need to reload the page...

Maybe I could get all posts and later filter them using Jquery  like this , but I don't like this option because I would have all the posts load on the page at once. And there is no function either that you can get all the posts and their tags together at the same time like:
blog_recent_tag_posts_with_their_tags

THX

 

0 Upvotes
1 Accepted solution
JVallejo7
Solution
Contributor

Custom filter by tag to blog listing

SOLVE

I just noticed that each pos have his own tag with this code

{{ post.tag_list }}

You can see this information in this post:
https://community.hubspot.com/t5/CMS-Development/Pull-tags-from-specific-blog-posts/m-p/600552#M2795...

View solution in original post

0 Upvotes
1 Reply 1
JVallejo7
Solution
Contributor

Custom filter by tag to blog listing

SOLVE

I just noticed that each pos have his own tag with this code

{{ post.tag_list }}

You can see this information in this post:
https://community.hubspot.com/t5/CMS-Development/Pull-tags-from-specific-blog-posts/m-p/600552#M2795...

0 Upvotes