I’m setting up video filtering and was wondering the best approach to take when combining multiple sets of pages.
When an event is logged on any checkbox, then a query would be run for all checkboxes that are :checked
that returns the objects in an array.
For each object in the array, I want to create a set following this pattern:
{{ $set := where .Site.Pages "Params.{{ $TAXONOMY }}" "{{ $TERM }}" }}
The traditional use of union
would result in something like the following:
{{ $set1 := where .Site.Pages "Params.taxonomy1" "exampleterm" }}
{{ $set2 := where .Site.Pages "Params.taxonomy2" "exampleterm" }}
{{ $set3 := union $set1 $set2 }}
{{ range $set3 }}
{{ .Params.title }}
{{ end }}
But the data set could potentially include any number of sets, so union
wouldn’t work for the intended use case.
Is there any way to nest where
statements to essentially accomplish the same purpose?