Blog topic suppression

SOLVE
jaala
Member

I am trying to figure out if there is a way to suppress a blog topic from appearing on the homepage of my blog. So, anytime I submit a blog post in that particular category it does not show up on the most recent blog posts. Is this possible?

0 Upvotes
1 Accepted solution

Accepted Solutions
Jsum
Solution
Key Advisor

@jaala,

 

This is really late so maybe won't be helpful but in your blog listing mark you have a for loop:

{% for content in contents %}

{% endfor %}

This where each of your blog posts on your listing page are created. You can add an unless statement to check if the blog has your topic.

{% for content in contents %}
    {% unless 'topic-to-hide' in content.topic_list|map('name') %}

       {# blog item markup #}

    {% unless %}
{% endfor %}

Now the blog for loop will put out all blogs unless the topic is the topic set in the if statement. 

 

 

 

View solution in original post

0 Upvotes
1 Reply 1
Jsum
Solution
Key Advisor

@jaala,

 

This is really late so maybe won't be helpful but in your blog listing mark you have a for loop:

{% for content in contents %}

{% endfor %}

This where each of your blog posts on your listing page are created. You can add an unless statement to check if the blog has your topic.

{% for content in contents %}
    {% unless 'topic-to-hide' in content.topic_list|map('name') %}

       {# blog item markup #}

    {% unless %}
{% endfor %}

Now the blog for loop will put out all blogs unless the topic is the topic set in the if statement. 

 

 

 

View solution in original post

0 Upvotes