Default setting on frontmatter

Hi ,
with this code I render a single.html page based on fontmattere user setting.
How to set a default render if the user dont set it on frontmatter?

{{- if eq .Params.type "standard-view" | default "standard-view"  -}}
	{{ partial "layout1.html" . }}
{{else}}
	{{ partial "layout2.html" . }}
{{- end -}}	

Thanks

My temporary solution pending your advice is:


{{- $type := .Params.type | default "standard-view" -}}

{{- if eq $type "standard-view" -}}
	{{- if eq .Params.sidebar true -}}
		{{ partial "layout1.html" . }}
	{{else}}
		{{ partial "layout2.html" . }}
	{{- end -}}			
{{end}}

Please advise me if you have a more effcient solution

Perhaps this can help

Thanks

This can also be useful: