# Using range where with front-matter values

**URL:** https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575
**Category:** support
**Created:** [May 7, 2019, 9:19pm UTC](https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575 "2019-05-07T21:19:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Duncan\_Mackenzie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/duncan_mackenzie/32/8639_2.png) [@Duncan\_Mackenzie](https://discourse.gohugo.io/u/Duncan_Mackenzie)
#### Post date: [May 7, 2019, 9:19pm UTC](https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575/1 "2019-05-07T21:19:10Z")

</div>

I have this in my front page template:

```auto
            {{- range where .Pages "Params.featured" "true" -}}
            <li>
                <a href="{{ .RelPermalink }}">{{ .Title }}</a>
                <!-- <div class="summary">{{.Summary}}</div> -->
            </li>
            {{- end -}}

```

and I have this in some of my post front-matter blocks:

```auto
---
date: 2019-05-07T13:30:00-07:00
title: Beer Tourism
type: posts
tags:
- Travel
- Beer
images:
- /images/beer_tourism.jpg
description: Finding interesting beer while traveling
featured: true
---

```

but the range statement isn’t returning anything. If I switch it to something like `range (first 3 .Pages)` that works as expected, but I would rather be pulling up a list of posts based on this front-matter value.

Can someone explain how the where should be used, and what I’m doing wrong? 🙂

Thanks!

```auto

```

---

<div class="post-metadata">

### Author: ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)
#### Post date: [May 7, 2019, 11:07pm UTC](https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575/2 "2019-05-07T23:07:15Z")

</div>

[Share the site you are working on](https://discourse.gohugo.io/t/requesting-help/9132), so we can see what’s happening. 🙂

---

<div class="post-metadata">

### Author: ![Duncan\_Mackenzie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/duncan_mackenzie/32/8639_2.png) [@Duncan\_Mackenzie](https://discourse.gohugo.io/u/Duncan_Mackenzie)
#### Post date: [May 7, 2019, 11:35pm UTC](https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575/3 "2019-05-07T23:35:57Z")

</div>

The code doesn’t work, so I haven’t pushed it live… because it doesn’t work 🙂

It is more of a technique question, how to pull back a list of posts based on a front-matter value

---

<div class="post-metadata">

### Author: ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)
#### Post date: [May 8, 2019, 3:51am UTC](https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575/4 "2019-05-08T03:51:57Z")

</div>

`"true"` is a string; `true` is a boolean.

---

<div class="post-metadata">

### Author: ![Duncan\_Mackenzie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/duncan_mackenzie/32/8639_2.png) [@Duncan\_Mackenzie](https://discourse.gohugo.io/u/Duncan_Mackenzie)
#### Post date: [May 8, 2019, 7:56pm UTC](https://discourse.gohugo.io/t/using-range-where-with-front-matter-values/18575/5 "2019-05-08T19:56:46Z")

</div>

That was it, thanks. Works perfectly now by just dropping the quotes around “true” when doing the where clause!
