CMS Development

rriveros
Member

blog_recent_tag_posts perfect match alternative

SOLVE

Hi all,

I've been digging around the community for few weeks for an answer, but seems no one is facing the same problem as me.

 

I'm currently using the blog_recent_tag_posts to filter posts based in 3 categories of tags. Unfortunately the blog_recent_tag_posts functionality search for posts who have at least 1 matching, but I need to run a perfect match. I saw few workarounds like filtering in hubl the results, but I reach that phase where I got more blog posts available than the total result search limit (100) so the results returned are innaccurate.

 

Is there any option available for blog_recent_tag_posts with perfect match option?

0 Upvotes
1 Accepted solution
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

blog_recent_tag_posts perfect match alternative

SOLVE

@dennisedson @rriveros as an alternate approach you could use the CMS Site Search API to return blog posts with a specific tag by using the filter parameters `&type=BLOG_POST` and `&property=tag` then you would use the `&term=` with the value of the tag name.

This should give you better results I would think but you are still limited to only 100 per page. But is super easy to paginate with the offset parameter.


Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

4 Replies 4
jonchim
Guide | Diamond Partner
Guide | Diamond Partner

blog_recent_tag_posts perfect match alternative

SOLVE

Hey @rriveros,

Let me know if you still need some assistance here. I believe the only way to do this is with if statements.

Are you trying to just filter the posts within those 3 categories only? So if a post had 2 of the 3 categories that post should show up in the results but currently it shows even if it had 1 of the 3?






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
rriveros
Member

blog_recent_tag_posts perfect match alternative

SOLVE

Hi Jon,

thanks. Yes, that's exactly my problem, posts which have less matching score(1 tag) are showing up first over posts with better score (2 or 3 posts). I found another post similar to mine were people use if statements to filter the results already loaded. The biggest challenge is that the database of blog posts our site manage is quite large(700+ posts), so for some categories a lot of posts are left out of the search (limited to 100 by hubspot). In many cases the results are looking very innacurate and I don't know if there is other mechanism. Even paginating the results in pages of 100s is fine for us.

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

blog_recent_tag_posts perfect match alternative

SOLVE

@stefen , any thoughts on how to work around this?

0 Upvotes
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

blog_recent_tag_posts perfect match alternative

SOLVE

@dennisedson @rriveros as an alternate approach you could use the CMS Site Search API to return blog posts with a specific tag by using the filter parameters `&type=BLOG_POST` and `&property=tag` then you would use the `&term=` with the value of the tag name.

This should give you better results I would think but you are still limited to only 100 per page. But is super easy to paginate with the offset parameter.


Stefen Phelps, Community Champion, Kelp Web Developer