Nested range problem

When posting code to the forum, please use code fences instead of blockquotes. See:
https://discourse.gohugo.io/t/sharing-code-in-the-forums/8968

The outer range is scoped to .Params.app_monthly_plans. That means your inner range is trying to iterate through .Params.app_monthly_plans.Params.app_feature_data, which doesn’t exist. Please read:
https://regisphilibert.com/blog/2018/02/hugo-the-scope-the-context-and-the-dot/

Instead of this:

{{range $index, $plan_feature := .Params.app_feature_data}}

Do this:

{{range $index, $plan_feature := $.Params.app_feature_data}}

Also, in the page’s frontmatter, make sure app_feature_data is defined before [[app_monthly_plans]].

1 Like