# Better range where filter multiple condition syntax

**URL:** <https://discourse.gohugo.io/t/better-range-where-filter-multiple-condition-syntax/6058>\
**Category:** feature\
**Created:** [April 6, 2017, 2:50pm UTC](https://discourse.gohugo.io/t/better-range-where-filter-multiple-condition-syntax/6058 "2017-04-06T14:50:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkebler](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dkebler/32/7285_2.png) [@dkebler](https://discourse.gohugo.io/u/dkebler)\
**Post date:** [April 6, 2017, 2:50pm UTC](https://discourse.gohugo.io/t/better-range-where-filter-multiple-condition-syntax/6058/1 "2017-04-06T14:50:56Z")

</div>

@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.

```auto
{{ range where .Data.Pages ( (".Params.hidden" "!=" true ) || ( ".File.BaseName" "!=" "hero" ) ) && ( "Sections" "mysection") ) }}

```

> **[\[Solved\] Nested "where" filters in a .Pages range statement - using .Scratch...](https://discourse.gohugo.io/t/solved-nested-where-filters-in-a-pages-range-statement-using-scratch-variable-to-offset-the-range-index/6038/18)**
>
> @budparr what you proprosed in the other thread works. Nested where's {{ range where ( where .Site.RegularPages "Section" "sections" ) ".Params.hidden" "!=" true }} I can take it from here. Thanks for you input and time. I'll call this...

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [April 6, 2017, 3:02pm UTC](https://discourse.gohugo.io/t/better-range-where-filter-multiple-condition-syntax/6058/2 "2017-04-06T15:02:11Z")

</div>

> <https://github.com/gohugoio/hugo/issues/3174>

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 6, 2017, 3:31pm UTC](https://discourse.gohugo.io/t/better-range-where-filter-multiple-condition-syntax/6058/3 "2017-04-06T15:31:03Z")

</div>

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.
