I have a repeater field which allows user to add text.
I’ve created an array which stores all these repeater values into an array called topics.
{% set topics = [] %}
<!-- append topics from repeater to array -->
{% for item in module.add_topics.topics %}
{% set topic_option = item|striptags %}
{% do topics.append( topic_option ) %}
{% endfor %}
<!-- dumping data
{{ topics }}
[Data, Accounting, Insight]
-->
The above is basically a predefined list. I now want to compare values in the above array to all blog tags that exist.
Demo:
{% set all_tags = blog_topics('default' , 250) %}
{{ all_tags }}
<!-- above prints: [Accounting, Press, Data] -->
So from the above two arrays, Data and Accounting are in both. I now want to create another array which has these matching values.
How can I go about this?