Hi,
I have a site param in my config.toml that determines the language.
I want to iterate over
Site.Data.projects.($Site.Params.languageCode)
is this somehow possible?
Hi,
I have a site param in my config.toml that determines the language.
I want to iterate over
Site.Data.projects.($Site.Params.languageCode)
is this somehow possible?
You have to use the index func:
index Site.Data.projects $Site.Params.languageCode
OK, but how do I combine this with range
?
Something like:
{{ range {{index .Site.Data.projects $Site.Params.languageCode}} }}
Untested, but this should work:
{{ range (index .Site.Data.projects $Site.Params.languageCode) }}
or if you prefer no parentheses:
{{ range index .Site.Data.projects $Site.Params.languageCode }}