CMS Development

MrCapp
Contributeur

Filter one topic from multiple blogs

I'm looking to modify the Post Filter to display topic tags for ALL blog posts.

 

Here's the scenario: we have a blog "home page" on our site that displays the latest posts from 4 different blogs (Business, Education, Customer Stories & Product News)

 

Within each of those blogs, we use the same tags - I'll use Professional Development as an example. We might have 3 Professional Development posts under Education and 5 under Business which you would see in the Posts by Tags section in the sidebar.

 

However, on the Blog Home Page, the Professional Development tag should display 8 (combining Education & Business)

 

I'm scratching my head as how to create a custom Post Filter module for the Home Page.

Any suggestions? Or can someone point me towards a help doc or tuorial?

 

Thanks for your time.

 

Standard Post Filter Module

{% if module.select_blog is number %}
  {% set select_blog = module.select_blog %}
{% else %}
  {% set select_blog = 'default' %}
{% endif %}

{% post_filter
  select_blog='{{ select_blog }}',
  expand_link_text='{{ module.expand_link_text }}',
  list_title='{{ module.list_title }}',
  filter_type='{{ module.filter_type }}',
  order_by='{{ module.order_by }}',
  max_links={{ module.max_links }}
%}

 

0 Votes
1 Réponse
tjoyce
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Filter one topic from multiple blogs

@MrCapp  - you can merge your blogs with something like this: 

{% set blogHolder1 = blog_recent_topic_posts('XXXXXX', 'business', 100) %}
  {% set blogHolder2 = blog_recent_topic_posts('YYYYYY', 'business', 100) %}
  {% set blogHolder3 = blog_recent_topic_posts('ZZZZZZ', 'business', 100) %}
  {% set blog_posts = (blogHolder1 + blogHolder2 + blogHolder3) | sort(true, false, 'publish_date')  %}

Then loop through the blog_posts dict.

 

Tim

http://www.belch.io