Better range where filter multiple condition syntax

@budparr Helped me to find a syntax for multiple where filtering using nested where. It works but can there be a more robust filtering syntax using operators like || , && . The nested where also is only an and conditional so no or is available.

I am talking something like what is available elsewhere in the template functions for complicated conditionals

Anything like this. Exact conditional operators and syntax doesn’t’ matter to me.

{{ range where .Data.Pages  (  (".Params.hidden" "!=" true ) ||  ( ".File.BaseName" "!=" "hero" ) )  &&  ( "Sections" "mysection") )  }}
1 Like
2 Likes

Once we get proper union/itersect you should logically have what you want. It may be suboptimal in the performance department (we will solve that later with some caches), but is much simpler to get right – both in the implementation and usage.

1 Like