{{- define "locaName" -}} {{- $col := .Context.Field.Column }} {{- if $col.NameLocalized }} {{- LocaFrontend $col.NameLocalized -}} {{- else }} {{- $col.NameInternal -}} {{- end }} {{- end -}} {{- define "renderValue" -}} {{ $octx := get . "octx" }} {{ $value := get . "value" }} {{ $type := $value.Type.String }} {{- template "locaName" $value }} [{{ $type }}] {{ if eq $type "TEXT" "STRING" }} {{ $value.ValueText }} {{ else if eq $type "DATE" }} {{ Datetime $value.ValueTime.From }} {{ else if eq $type "NUMBER" }} {{ $value.ValueInt }} {{ else if eq $type "INTEGER_2" }} {{ $value.Integer2ToString (get $ "octx") }} {{ else if eq $type "DATETIME" }} {{ Datetime $value.ValueTime.From }} {{ else if eq $type "DATERANGE" }} {{ $value.ValueDateRange }} {{ else if eq $type "NESTED" }} {{ else if eq $type "REVERSE_NESTED" }} {{ else if eq $type "BOOLEAN" }} {{ if $value.ValueBool }} Yes {{ else }} No {{ end }} {{ else if eq $type "FILES" }} {{ range $idx, $file := $value.Files }} {{ if $file.Preferred }} {{ $file.File.Filename}} {{ $version := BestImage $value $file.File }} {{ if $version }} {{ end }} {{ end }} {{ end }} {{ else if eq $type "TEXT_LOCA" }} {{ LocaData $value.ValueLoca }} {{ else if eq $type "CUSTOM" }} {{ toString $value.ValueCustomData.Data }} {{ else if eq $type "LINKED" }} {{- LocaData ($value.LinkedObject.RenderStandard $octx.StandardLangs 0) -}} {{ end }} {{ end }} {{ define "renderRecord" }} {{ $octx := get . "octx" }} {{- range $idx, $value := (get . "rec") -}}
{{- template "renderValue" dict "value" $value "octx" $octx -}}
{{- end -}} {{ end }} {{ if .Object }} This is a demo html renderer for FYLR for {{ .User.CompileDisplayname }}

{{ LocaData (.Object.RenderStandard .OutputContext.StandardLangs 0) }}

#{{ .Object.SystemObjectId }}

{{ template "renderRecord" (dict "rec" .Record "octx" .OutputContext) }} {{ $iiifURL := printf "%s/api/v1/objects/uuid/%s/format/iiif/v3/manifest.json" extServerURL .Object.Uuid }}

{{ end }} {{ if .Value }} {{ template "renderValue" (dict "value" .Value "octx" .OutputContext) }} {{ end }}