Can't access Site variables inside nested partial

You need to pass multiple values to your feature partial, but partials only take a single context parameter. To cram multiple values into a single value, you can build a dictionary on the fly.

In sections/products.html:

{{ partial "sections/feature.html" (dict "feature" . "ctx" $) }}

Then in sections/feature.html:

{{ .feature }}
{{ .ctx.Site }}
6 Likes