# Check a Menu Link Label for specific text

**URL:** <https://community.hubspot.com/t/check-a-menu-link-label-for-specific-text/103119>\
**Category:** CMS Development\
**Created:** [March 21, 2024, 4:09pm UTC](https://community.hubspot.com/t/check-a-menu-link-label-for-specific-text/103119 "2024-03-21T16:09:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmcmillan99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tmcmillan99/32/93181_2.png) [@tmcmillan99](https://community.hubspot.com/u/tmcmillan99)\
**Post date:** [March 21, 2024, 4:09pm UTC](https://community.hubspot.com/t/check-a-menu-link-label-for-specific-text/103119/1 "2024-03-21T16:09:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [March 21, 2024, 6:21pm UTC](https://community.hubspot.com/t/check-a-menu-link-label-for-specific-text/103119/2 "2024-03-21T18:21:32Z")

</div>

Hi @tmcmillan99,

you can try

```lia-code-sample
{% if link.label is containing "mega" %}
Do something
{% else %}
Do something if it's not containing "mega"
{% endif %}

```

best,

Anton

---

<div class="post-metadata">

**Author:** ![tmcmillan99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tmcmillan99/32/93181_2.png) [@tmcmillan99](https://community.hubspot.com/u/tmcmillan99)\
**Post date:** [March 21, 2024, 6:52pm UTC](https://community.hubspot.com/t/check-a-menu-link-label-for-specific-text/103119/3 "2024-03-21T18:52:21Z")

</div>

@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
