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 %}
<a href="/the-url" class="{{ macros.is_active('test1', 'test2', 'test3') }}">Link Title</a>
It's not working. How would I go about this ?