I have a list of topics:
list1 = [topic1, topic2, topic3, topic4, topic5, topic6]
I would like to check another list against this list:
list2 = [topic2, topic4, topic6]
something like this:
{% if list2.items in list1 %}
where each item from list2 is checked for in list1. if all or any of the items from list2 are in list 1 then it's True. I figured this would be simple but I can't seam to find anything helpful about this.
Full example:
{% set list1 = [topic2, topic4, topic6] %}
{% for post in posts %}
{% set list2 = [topic1, topic2, topic3, topic4, topic5, topic6] %}
{% for topic in list2 %}
{% if topic in list1 %}
{# output of post list based on conditions #}
{% endif %}
{% endfor %}
{% endfor %}
** I am working in a cms with out server side access so I only have the templating language to work with.