How to get the value from a scope in multidimensional ranges?

I have two ranges:

{{ range $data.someparent.object }}
    {{ range .subarray }}
         //How can I get a value from the '.someparent.object' here?
    {{ end }}
{{ end }}

Ah understood, is this the only way?

{{ range $data.someparent.object }}
    {{ $value := .someValue }} 
    {{ range .subarray }}
         {{ $value }}
    {{ end }}
{{ end }}

Seems a little hacky.

It is not hacky. It is exactly how the concept of context works.

Feels hacky :smiley: Thank you.

A variable is never hacky. It is basically one of the ground pillars of programming. A range can be seen as function in other programming languages and having a variable that contains information from outside of the function is quite normal.

Terming that “hacky” will result in the villagers (at least in development communities) coming for you with pitchforks and torches.

This is definitely a hack. But understand why it needs to be this way.

It’s not. Please research the Dunning-Kruger-Effect.

Yes it is, research . But I guess I can’t argue with the ‘superior’ Hugo forms.

What’s wrong with this community? You understand not everyone wants to work with Hugo and that you have to work with what you’re given for certain projects. The amount of arrogance and superiority is ridiculous.