I have to a get different config data to the {{ range }} depends of the page Type. And can’t realise how.
I do something like bellow but it doesn’t work
{{- if eq $.Type "te" }}
{{- $socials := .Site.Params.social_item_te -}}
{{ else }}
{{- $socials := .Site.Params.social_item -}}
{{ end -}}
{{ range $socials }}
{{- if .link -}}
<a title="{{- .title -}}" href="{{- .link -}}" target="_blank" rel="noopener"><span class="icon-round themeicon themeicon-{{ .icon }}"></span></a>
{{- end -}}
{{ end }}
You define a variable with := and override it with =. I think you need a $socials outside of the if/else with := and inside the if/else only use =.
Also - if you are ranging over it, you need to make sure it’s a slice/array/rangeable thingy. Depending on where you have this code the . might not be the root-. - Try $.Site.Params.social_item.