Passing multiple arguments to a macro? I have a link on a website that i'd like to set a class of active on, based on different segments.
{% macro is_acitve(segment) %}
    {% if craft.app.request.getSegment(2) == segment %}active{% endif %}
{% endmacro %}

&lt;a href=&quot;/the-url&quot; class=&quot;{{ macros.is_active('test1', 'test2', 'test3') }}&quot;&gt;Link Title&lt;/a&gt;

It's not working. How would I go about this ?
You might be better off sending the values as an array, then you will only need one parameter.
{# Change the macro to check for the value in an array #}
{% macro is_active(segments) %}
    {% if craft.app.request.getSegment(2) in segments %}active{% endif %}
{% endmacro %}

{# Send an array to the macro #}
&lt;a href=&quot;/the-url&quot; class=&quot;{{ macros.is_active(['test1', 'test2', 'test3']) }}&quot;&gt;Link Title&lt;/a&gt;