{{#if excerpt}} hides excerpt from non-members?

Ghost Version
5.0.2

I’m using a customized version of Casper, and I noticed that once I updated to the latest version (5.0.0 and up), excerpts are no longer displayed for non-members. I narrowed this down to this new if statement around {{excerpt}} in post-card.hbs:

{{#if excerpt}}
       <div class="post-card-excerpt">{{excerpt}}</div>
{{/if}}

I had assumed this was only a check to be sure an excerpt exists, but when the if statement is removed, the excerpt is again visible to non-members.

Is this expected behavior? I wasn’t able to find any mention of it here or in the docs.

Thanks!

Although the terms are the same, it’s actually two different things at work. The first is the excerpt property on the post, the second is the excerpt helper. This difference is why one can render false, while the other generates text.

If you want more explicit control over this, you can use custom_excerpt, which will render your excerpt exactly as it’s written in the Editor excerpt field, independent of the member status.

1 Like

Thanks, @TheRoyalFig! Switched to {{#if custom_excerpt}} like you suggested, and that did the trick.

1 Like