CMS Development

UndecidedTool
Member

*Please Help* Listing Topics from 5 blogs

SOLVE

Hey, all!

So, I've got a bit of an issue. I am trying to build a module that will display up to 10 topics, by order of most posts within each.

The catch is, I'm attempting to pull from 5 different Blog IDs all of the topics from all, along with the amount of posts across the board.

I've spoken with HubL support twice, and both of them said that it looks like it should work - in theory. But, there's something missing in the code and I can't figure out what it is. (I'm almost positive it's just that something somewhere says "topic" instead of "post" or vis-versa.)

Please check it out, and let me know if you've got any ideas! Smiley Happy

<!-- reference all blogs below -->
{% set blog_one_topics = blog_topics('4487087104') %}
{% set blog_two_topics = blog_topics('4864011385') %}
{% set blog_three_topics = blog_topics('4864011545') %}
{% set blog_four_topics = blog_topics('4617138904') %}
{% set blog_five_topics = blog_topics('4702562036') %}

<!-- combine into one label -->
{% set all_topics = (blog_one_topics + blog_two_topics + blog_three_topics + blog_four_topics + blog_five_topics) %} 

<div>

<h2>TRENDING TOPICS</h2>

<!-- pull list -->
{% for topic in all_topics %}
    {% if loop.index == 1 %}

<p>{% post_filter "posts_by_topic", overrideable=False, list_title ='', max_links=10, filter_type='topic', label='Posts by Topic', title_tag='span' %}</p>

</div>

    {% endif %}
{% endfor %}

Thanks for your help! 

- Anthony

2 Accepted solutions
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

*Please Help* Listing Topics from 5 blogs

SOLVE

@UndecidedTool I believe the issue is in your for loop. Use "for all_topic in all_topics" instead.

Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

0 Upvotes
UndecidedTool
Solution
Member

*Please Help* Listing Topics from 5 blogs

SOLVE

@stefen I changed it to all_topics but no change.

Thanks for your reply! 🙂

 

UPDATE ******************

Found that there is a select_blog="id" option for this filter -

But still will not let me reference multiples.

{% post_filter "posts_by_topic", select_blog='####', overrideable=False, list_title ='', max_links=100, filter_type='topic', label='Posts by Topic', title_tag='span' %}

View solution in original post

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

*Please Help* Listing Topics from 5 blogs

SOLVE

@UndecidedTool I believe the issue is in your for loop. Use "for all_topic in all_topics" instead.

Stefen Phelps, Community Champion, Kelp Web Developer
0 Upvotes
UndecidedTool
Solution
Member

*Please Help* Listing Topics from 5 blogs

SOLVE

@stefen I changed it to all_topics but no change.

Thanks for your reply! 🙂

 

UPDATE ******************

Found that there is a select_blog="id" option for this filter -

But still will not let me reference multiples.

{% post_filter "posts_by_topic", select_blog='####', overrideable=False, list_title ='', max_links=100, filter_type='topic', label='Posts by Topic', title_tag='span' %}

0 Upvotes
tjerben
Participant

*Please Help* Listing Topics from 5 blogs

SOLVE

having same issue.. grateful for any answers..

0 Upvotes