# The #has handlebars helper not working with visibility?

**URL:** <https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963>\
**Category:** Developer help\
**Created:** [November 3, 2019, 12:18am UTC](https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963 "2019-11-03T00:18:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MLFromScratch](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mlfromscratch/32/2278_2.png) [@MLFromScratch](https://forum.ghost.org/u/MLFromScratch)\
**Post date:** [November 3, 2019, 12:18am UTC](https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963/1 "2019-11-03T00:18:21Z")

</div>

I was just doing some development on my theme and I wanted to have custom messages on paid and members only posts. So I figured I would look up the documentation – and it turns out Ghost supports a #has function.

I tried to test the following code, but it did not work. The syntax is correct, else handlebars handily fails to load the page, but it does not have the desired effect.

```
{{#has visibility="paid"}}
    <span class="post-visibility post-visibility-{{visibility}}">Premium Post</span>
{{else has visibility="members"}}
    <span class="post-visibility post-visibility-{{visibility}}">Subscribers Only</span>
{{/has}}

```

It seems that the equality never goes through, even though the only options are paid, members and public.

So I’m confused, how am I supposed to implement this sort of functionality?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [November 3, 2019, 5:43am UTC](https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963/2 "2019-11-03T05:43:12Z")

</div>

So the has helper doesn’t work with members data, but there are a couple of variables available:

[https://ghost.org/docs/members/content-visibility](https://ghost.org/docs/members/content-visibility)

I don’t think it’s possible for you to run your logic using just helpers - there is boolean member information but not boolean post visibility information 🤔

---

<div class="post-metadata">

**Author:** ![MLFromScratch](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mlfromscratch/32/2278_2.png) [@MLFromScratch](https://forum.ghost.org/u/MLFromScratch)\
**Post date:** [November 3, 2019, 12:56pm UTC](https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963/3 "2019-11-03T12:56:04Z")

</div>

Yeah unfortunately, this is not possible. But maybe in the future, when the helpers are extended to the new members helpers.

---

<div class="post-metadata">

**Author:** ![fueko](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fueko/32/41538_2.png) [@fueko](https://forum.ghost.org/u/fueko)\
**Post date:** [November 3, 2019, 1:15pm UTC](https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963/4 "2019-11-03T13:15:34Z")

</div>

Hello! @MLFromScratch

Maybe it will be useful to you:

```auto
<style>
.premium,
.free {
   display: none;
}

.premium.paid,
.free.members {
   display: block;
}
</style>

{{#if access}}
{{content}}
{{else}}			
<div class="premium {{visibility}}">
	<h2>Paying subscribers only</h2>
	{{#if @member}}
	<p>Upgrade your account</p>
	{{else}}
	<p>Sign up now and upgrade your account</p>
	{{/if}}
</div>
<div class="free {{visibility}}">
	<h2>Subscribers only</h2>
	<p>Sign up now</p>
</div>
{{/if}}

```

---

<div class="post-metadata">

**Author:** ![MLFromScratch](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mlfromscratch/32/2278_2.png) [@MLFromScratch](https://forum.ghost.org/u/MLFromScratch)\
**Post date:** [November 3, 2019, 3:21pm UTC](https://forum.ghost.org/t/the-has-handlebars-helper-not-working-with-visibility/9963/5 "2019-11-03T15:21:36Z")

</div>

Hey fueko, this definitely does look like a solution, I was just hoping for something much simpler 🙂
