How to if isset a menu identifier


How do I set an if isset a menu identifier ?

{{ range .Site.Menus.main }}
  {{ if isset .Identifier }}data-id="{{ .Identifier }}"{{end}}

This is what I have so far, but it doesn’t seem to work. i looked at hugo documentation on conditionnels but only talks about params.

Thank you!

Try something like this: isset .Params "comments". Otherwise Hugo don’t know what you’re looking for.

Another example:

{{ if (not (isset .Params "some_variable")) }}
    do something
{{ end }}

Here’s one of my gists about isset as well:

Thank you, but in my post I talk about params already. I know how to isset with params, I don’t know how to isset a menu identifier.

I’m guessing this is impossible?