{{ $pageform := (index .context.Page.Params.forms .form) }} {{ $group := slice }} {{ $divide := .context.Page.Params.divide }}
{{ range $pageform.fields }} {{ $title := .title }} {{ $name := $title }} {{ if .name }} {{ $name = .name }} {{ end }} {{ if and .group (not (in $group .group))}}
{{ if i18n (singularize .group) }}{{ i18n (singularize .group) }}{{ else }}{{ humanize .group }}{{ end }} {{ partial "layout/generator/expand" (dict "name" (printf "%sgroup" .group)) }}
{{ $group = $group | append .group }} {{ end }} {{ if eq .input_type "title" }}

{{- $name -}}{{- if .required -}}{{- " *" -}}{{- end -}}

{{ else if eq .input_type "textarea" }}
{{ else if eq .input_type "radio" }}
{{ else if eq .input_type "checkbox" }}
{{ else if eq .input_type "results" }}
{{ else if eq .input_type "submit" }}
{{ else if eq .input_type "mc" }} {{ $in0 := .title }} {{- $finale := slice -}} {{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }} {{ if eq .title "tags" }} {{ range $pages }} {{- with .Params.tags -}} {{- $finale = $finale | append . -}} {{ end }} {{ end }} {{ else if eq .title "foundations" }} {{ range resources.Match "/foundations/*" }} {{ $n := path.Base (strings.TrimSuffix (path.Ext .Name) .Name) }} {{- $finale = $finale | append $n -}} {{ end }} {{ range $pages }} {{- with .Params.foundations -}} {{- $finale = $finale | append . -}} {{ end }} {{ end }} {{ else }} {{ range $pages }} {{ range .Param $in0 }} {{- $finale = $finale | append . -}} {{ end }} {{ end }} {{ end }} {{- $finale = $finale | uniq -}}
{{ .name }} {{ if ne .expanded true }}{{ partial "layout/generator/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }}{{- if .required -}}{{- " *" -}}{{- end -}}
{{ range sort $finale }} {{ end }}
{{ if .new }} {{ end }}
{{ else }} {{ if eq .title "name" }}
{{ else if eq .title "address" }}
{{ else }}
{{ end }} {{ end }} {{ end }}