Check a Menu Link Label for specific text

Is there a way that I could see if a link label contains specific text in an if statement? For example, the menu item label contains the following:

<span class=“mega-1”>Services</span>

I want the if statment to check if the label contains “mega”.

{% if link.label ??? %}

The goal is to account for a certain scenario in my menu macro.

Thanks,

Terry

Hi @tmcmillan99,

you can try

{% if link.label is containing "mega" %}
Do something
{% else %}
Do something if it's not containing "mega"
{% endif %}

best,

Anton

@Anton

Thanks for the reply. I will give that a try. I realized that I didn’t dive deep enough into the Hubspot docs or I would have found that option under the Expression tests.

Thanks,

Terry