Members only dowload link

Hi

Is there a way to show a download link on a post only to paid members.

I am being forced to lock entire articles where I actually just want to lock the download link.

thanks

This is the code I am using for a download button link. How can I make it visible to members only?

You could wrap it in an if handlebars helper, e.g.

{{#if @member}}
  ... download button ...
{{/if}}

Docs for the member properties are here https://ghost.org/docs/members/member-data/#member-attributes

[quote=“fabien, post:2, topic:18318”]

{{/if}}

I tried the above, it is not working.

What is not working? What do you see, and what do you expect to see?

Where are you including this code? It looks like a screenshot of a notes application :thinking:

Is this in your theme?

I am adding this code to a html card on a post.

I want only members.paid to be able to see a download link I post. That way I will not have to lock the whole post.

"

a.custom-button { background-color: #fff; border: 1px solid #6AB3C5; border-image: none 100% 1 0 stretch; border-radius: 5px; box-sizing: border-box; color: #6AB3C5; cursor: pointer; display: block; fill: #6AB3C5; font-size: 12px; font-weight: 800; height: 44px; letter-spacing: 2px; line-height: 44px; margin-bottom: 20px; overflow: hidden; padding: 0 10px; text-align: center; box-shadow: none; text-decoration: none; text-transform: uppercase; } {{if @member.paid}} Click to Download Powerpoint Version {{/if}} "

one of the problems is that you missed the # before the if statement

fabien code:

{{#if @member}}
  ... download button ...
{{/if}}

your code:

{{if @member}}
  ... download button ...
{{/if}}

try it:

{{#if @member.paid}}
 your code
{{/if}}

Thanks. This will be between the body and /body tags right?

This is what I see when I publish your code

image

you can’t use this code here, you need to create a custom template page