Hide parts of the content for non-subscribers

Hi there,

ghost has the handlebars filter {{#unless @member}}. Is there a way/plugin to use that within the content of a post?

What I want to do

I’d like to add content upgrades to my post only for (free or paid) subscribers. Those content upgrades are at different places within a blog post.

Thus, the Public Preview Card is not sufficient, because I don’t want to put everything at the end of the post. This would just be confusing.

Ideally, I could add some sort of preview or description to non-subscribers.

How this could look like:

What non-subscribers see What subscribers see
Discover the 7 elements for [something relevant for audience]

Sign up to get access for this part of the content.

[Sign-up button]
If you want to truly succeed at [something relevant for audience], then consider using these 7 techniques:

1. Foo
2. Bar
3. …

Is something like this possible? If so, how?

Thanks in advance for your input :)

You should dive into {{visibility}} at post context.

Thanks for your quick reply.

Does ghost evaluate handlebars code within a blog post’s content? I wasn’t aware about that. I thought it’s only possible to use handlebars in themes itself.

Does ghost evaluate handlebars code within a blog post’s content?

No, Ghost doesn’t. Whether you use a functional helper or public preview card, free content will be separated from paid content.

To put free content within paid content, you need to use Member API to check the user’s paid status and then dynamically insert free content into paid content.

Thanks for the clarification.

Do you happen to have some resources at hand you could point me to (besides the docs, OFC—cheching them out right now).

It would be a great first start to understand how

  1. the separation of the public preview card, and/or
  2. the sign up card (as it is only shown to “unknown” readers")

works. Unfortunately, I can’t find the relevant code in the github repository.

I’m not sure about the details, but they are related to the content helper. You might trace it.