{{ $scratch := newScratch }} {{ range where .this.Site.Pages ".Params.type" "!=" "outcome" }} {{if in (index .Params $.field) $.name }} {{ $scratch.Add "pages" (slice .) }} {{ end }} {{ if and (eq .Params.type "team") (in .Params.members $.name) }} {{ range .Params.sessions }} {{ $session := index (where (where $.this.Site.Pages ".Params.title" .) ".Params.type" "!=" "outcome") 0 }} {{ $scratch.Add "pages" (slice $session) }} {{ end }} {{ end }} {{ end }} {{ $all_sessions := $scratch.Get "pages" }} {{ range $all_sessions }} {{.Params.title}} {{ .Params.description }} {{ .Params.type }} {{ .Params.when_day }} {{ .Params.when_time }} {{ with (eq $.field "organizers") }} organiser {{ end }} {{ with (eq $.field "participants") }} participant {{ end }} {{ end }}