Hello, is this possible to create label-based posts in ghost? I don’t have stripe integration because my blog has no paid subscription (and also stripe isn’t available in every country in the world) and i need to create post that can access only specific users.
So the question is:
-is it possible to make ghost posts only for user with specific label?
ro
-maybe there is ready to use solution with NFT-based auth ?
Handlebars doesn’t have access to member labels (although I’d be happy to be corrected if I’m wrong). But you can link Stripe (even in test mode) and then give users complimentary access to a tier. (This can be done with the API, if you’re collecting payment another way.) You’ll want to disable showing those tiers in Portal, so that users can’t sign themselves up that way.
That gets you access to Ghost’s tier restricted posts, without actually having to take payments by Stripe.
Do test before you deploy - it’s a little bit of a hack.
You are genius man, thanks you a lot))) Maybe it’s not the best and secure way but it works!
Hi Cathy, I am resurrecting this thread because I was looking for a label access solution in themes. I was able to log the member object with all labels in the theme. I am not sure if that is something new in the newest Ghost version 5.79.4 but it seems to be working.
{{#if @member}}
{{#foreach ../_locals.member.labels as |label|}}
{{#match label.slug "=" 'test-label'}}
{{> content}}
{{/match}}
{{/foreach}}
Wow. That’s a game changer!
I think so, not sure how long it is there. Hopefully it will not be subject of change.
I have tested it for a website created through Ghost Pro and it did not work out. Probably it is only working for self-hosted Ghost websites.
This approach no longer works. Labels have been moved under the member object. You can log them in console when running Ghost in dev mode.
{{log member.labels}}
I see, thanks. It is helpful.