{{- $contextType := printf "%T" . -}} {{- $isShortcode := (eq $contextType "*hugolib.ShortcodeWithPage") -}} {{/* --------------------------------------------------------------------------- SECTION TITLE --------------------------------------------------------------------------- */}} {{- $title := "" -}} {{- if $isShortcode }} {{- $title = .Get "title" -}} {{ else }} {{- $title = i18n "testimonials_title" -}} {{ end }} {{/* --------------------------------------------------------------------------- TESTIMONIALS COLLECTION --------------------------------------------------------------------------- */}} {{- $testimonials := (where .Site.RegularPages.ByDate "Type" "testimonial") -}} {{- if not $isShortcode }} {{- $baseLangSite := .Sites.Default -}} {{- $testimonials = $testimonials | lang.Merge (where $baseLangSite.RegularPages.ByDate "Type" "testimonial") -}} {{- end -}} {{/* sectionId: Optional argument to override the default HTML id for this section. If not provided, the default id is used. */}} {{ $sectionId := "testimonial" }} {{ with .Get "sectionId" }} {{ $sectionId = . }} {{ end }}
{{/* When passed from a shortcode, the context type is *hugolib.ShortcodeWithPage. When passed from a partial included in a page via params, the context type is *hugolib.pageState. */}}

{{ $title }}

{{ range $testimonials }}
{{ .Content }}
{{ partial "lazypicture" (dict "src" .Params.image.src "scale" .Params.image.scale "pictureclass" "picture testimonial col-2" "alt" $title)}}

{{ .Params.name }}

{{ .Params.position }}
{{ end }}