# .IsHome returns false inside range

**URL:** <https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073>\
**Category:** support\
**Created:** [December 18, 2020, 11:57am UTC](https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073 "2020-12-18T11:57:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [December 18, 2020, 11:57am UTC](https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073/1 "2020-12-18T11:57:29Z")

</div>

Pretty much just what the title says, this code will return false when rendered inside index.html.

Makes sense to me because I am going through a section of the site to fetch content, but felt like it might be worth to raise the flag.

```auto
{{ range where (.Site.GetPage "section" "story").Sections ".Params.options.unlisted" false | intersect (where .Site.Pages "Params.story_featured" "=" true) }}
{{ partial "story-card.html" . }}
{{ end }}

```

story-card.html:

```auto
<div class="
{{ if .IsHome }}
	col-md-4
	{{ else }}
	col-md-6
{{ end }}
col-lg-4
">

```

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [December 18, 2020, 12:00pm UTC](https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073/2 "2020-12-18T12:00:33Z")

</div>

I think that you need to use the dollar sign in this case like `$.IsHome` or `$.Page.IsHome`

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [December 20, 2020, 2:19pm UTC](https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073/3 "2020-12-20T14:19:27Z")

</div>

Tried both and it keeps giving out the same result. But your reasoning is sound, if I am inside a range or partial, the $ should have worked.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [December 20, 2020, 2:40pm UTC](https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073/4 "2020-12-20T14:40:37Z")

</div>

Also try `if eq $.Permalink .IsHome` and variations.

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [December 21, 2020, 12:17am UTC](https://discourse.gohugo.io/t/ishome-returns-false-inside-range/30073/5 "2020-12-21T00:17:54Z")

</div>

Didn’t work either. I guess the only workaround would be to pass a variable to the partial.
