CMS Development

UndecidedTool
Mitglied

*Please Help* Listing Topics from 5 blogs

lösung

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 (fröhlich)

<!-- 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 Akzeptierte Lösungen
stefen
Lösung
Autorität | Partner
Autorität | Partner

*Please Help* Listing Topics from 5 blogs

lösung

@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

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
UndecidedTool
Lösung
Mitglied

*Please Help* Listing Topics from 5 blogs

lösung

@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' %}

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
3 Antworten
stefen
Lösung
Autorität | Partner
Autorität | Partner

*Please Help* Listing Topics from 5 blogs

lösung

@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
Lösung
Mitglied

*Please Help* Listing Topics from 5 blogs

lösung

@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
Teilnehmer/-in

*Please Help* Listing Topics from 5 blogs

lösung

having same issue.. grateful for any answers..

0 Upvotes