CMS Development

mehdi
Member

How to show most popular blog from combined multiple blogs?

Consider we have 3 blogs and each of them have hundreds of blog posts. Now we want to show the 2 most popular from all of the combined blogs. This doesn't seem to be possible. Any ideas on this? We prefer not to use web APIs for such a small sorting issue!

 

Fetching most popular individual blogs works great:

{% set blog1= blog_popular_posts(111111111, limit=3) %}

{% set blog2= blog_popular_posts(222222222, limit=3) %}

{% set blog3= blog_popular_posts(333333333, limit=3) %}

 

Now we have 3 most popular blogs from each of them. But it is possible that blog1 has the most popular posts of them all.

 

Now combining them:

{% set allPopularBlogs = (blog1+ blog2+ blog3) | sort(true, false, 'publish_date') %}

 

But allPopularBlogs will be now sorted on published date. I thought there were a variable for performance views too so I can do this:

allPopularBlogs = (blog1+ blog2+ blog3) | sort(true, false, 'performance_views') 

 

But there is no such variable called performance_views which I can sort from. Any ideas on this?

 

Thanks!

7 Replies 7
celenajasmin
Participant

How to show most popular blog from combined multiple blogs?

Interested to know if there's a solution to this as well!

0 Upvotes
jennysowyrda
Community Manager
Community Manager

How to show most popular blog from combined multiple blogs?

Hi @mehdi,

 

Sorry for the delay in reaching out to you! 

 

Have you tried the steps outlined in this thread?

 

@tjford and @JagadishINB do you have any suggestions for @mehdi in regards to showing popular blog posts from multiple blogs? 

 

Thank you,
Jenny

0 Upvotes
mehdi
Member

How to show most popular blog from combined multiple blogs?

Hi @jennysowyrda 

The link you mentioned doesn't combines blog posts. It just uses a single blog post. I couldn't solve this yet.

Thanks.

0 Upvotes
jennysowyrda
Community Manager
Community Manager

How to show most popular blog from combined multiple blogs?

Thanks @mehdi!

 

Do you have any examples of what you are looking to accomplish from other sources, or links to your current set up?

 

I want to pull in some subject matter experts to see if they have any thoughts to add: @jonlcrow@COSCOGS do you have any suggestions? I did find this thread with @josephLayden with what could be a workaround or at least a starting point. 

 

Thank you,

Jenny

0 Upvotes
Bioclader
Member

How to show most popular blog from combined multiple blogs?

We have almost the same issue and your Hubspot blog shows the solution, but we don not know how to set it up:

 

Your blog consists actually of the Marketing (https://blog.hubspot.com/marketing), Sales (https://blog.hubspot.com/sales) and Service Blog (...), but they have a common landing page (blog.hubspot.com).

 

How did Hubspot structure their blog to do so? This will answer our problem, but most likely it is the same question asked initially.

0 Upvotes
mehdi
Member

How to show most popular blog from combined multiple blogs?

What hubspot has done on their page https://blog.hubspot.com/ is completely different and easily achievable. But we wanted something else. We wanted to combine the many blogs and then show most popular.

 

0 Upvotes
Bioclader
Member

How to show most popular blog from combined multiple blogs?

Can someone explain me how Hubspot setup its different blogs with the Global blog page?

0 Upvotes