{{define "relation_list"}} {{$format := "html"}} {{if .format}} {{$format = .format}} {{end}}

{{$title := .options.title}}{{if .title}}{{$title = .title}}{{end}}{{$title}}

{{if (.data|isSlice)}} {{if gt (len .data) 0}}
{{range $el := .data}} {{$el | string}} {{if $.small}} {{range $s := $.small}}
{{if $.smallOptions}} {{template "small" dict "options" ($.smallOptions | yaml) "data" ($el|field $s)}} {{else}} {{template "small" dict "data" ($el|field $s)}} {{end}}
{{end}} {{end}} {{end}}
{{else}}

{{.noElements}}

{{end}} {{else}} {{if .data}}
{{.data | string}} {{if .small}} {{range $s := .small}}
{{$options := `noElements: "nessun elemento"`}} {{template "small" dict "options" ($options | yaml) "data" (.data|field $s)}}
{{end}} {{end}}
{{else}}

{{.noElements}}

{{end}} {{end}} {{end}}