ANDing where conditions

Sorry if this has been asked before, but it’s a tricky one to search on.

I am trying to retrieve a collection of content (active projects) based upon two conditions. Here’s what I have so far:

{{ range (where .Site.Pages.ByDate.Reverse "Section" "project") }}

{{ range (where .Site.Pages.ByDate.Reverse ".Params.state" "active") }}

How can I combine both of those into a single statement?

Thanks!

2 Likes

Try something like this:

{{ range (where (where .Site.Pages.ByDate.Reverse "Section" "project") ".Params.state" "active") }}
7 Likes

Thanks. That does the trick.