Display content in blog post depending on set Topic


#1

Hi,

We want to display a certain content depending on what the individual blog post topic is set as.

So if the blog post is set to “Finance” it should display a custom module named FinanceModule for example.

How do we achieve this?

I’ve set an individual blog post to Finance an tried

    {% if topic 'Finance' %}
        <h1>
            News!
        </h1>
    {% endif %}

#2

Found a solution. Works well

     {% if 'TOPIC-NAME-HERE' in content.topic_list|map('name') %}
    <h1>YOUR TOPIC-SPECIFIC CONTENT HERE</h1>
    {% endif %}