MNTP - Check string for CurrentPage Id

Hi Guys

I Got theses two areas at my website:

Employees:

  • Mads
  • Kristian
  • Sophie

Areas:

  • Development
  • Design
  • Tech

The employees can be attached to multiple areas with an property of Multinode Treepicker.

When i’m at the page development i would like to show alle employees that have the value og e.g. development (Mads and Sophie).

And my code looks like this right now:

@foreach(var item in CurrentPage.AncestorOrSelf(2).Descendants("Ansatte").Where("Visible")){
       
   @*Check if item.Areas Contains CurrentPage.Id*@
   if(item.areas.Contains(CurrentPage.Id)){
      <h1>@item.Name etc.</h1>
   }
}

This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/75717-mntp-check-string-for-currentpage-id