How to Ensure Memberstack Content Is Visible Only to Intended User Plans Answered
Hey everyone,
Is it possible to add multiple plans in the attribute to hide if any of them are checked.
For example, I want to show an item to only paid users and hide it from free users
so hence data-ms-content="!pro-plan"
and data-ms-content="pro-plan"
but the element with attribute "!pro-plan" is still showing even for users not signed up
How can I set it so it doesn't show for non-signed-up users as well? 🙏
Comments
12 comments
Hi Manuel,
These are the right attributes to use:
data-ms-content="paid-plans"
Only visible to all logged-in members who have a paid plan.
data-ms-content="!paid-plans"
Only visible to all logged-in members who do not have a paid plan.
The thing is I'm not using stripe paid plans.
I have 2 free plans, and one is tagged as paid 😢
Oh in that case, you would have to resort to Javascript. Give me some minutes to come up with something.
Oh okay thanks.
Would try here as well and see if it works.
Also, replace "pln_IDForFreePlanA" and "pln_IDForFreePlanA" with their plan ID's on your Memberstack dashboard.
Yeah tried it, and not working.
It's showing both of the items
and for users not signed up/login
It shows an error on console Unauthorize
website URL: flowscriipt.webflow.io
here's the link where the code is https://flowscriipt.webflow.io/app/dashboard
I tried this and it kinda worked, it checked if it could get the current user, and if not, set the element to display none. (though it still shows that console error. :)
Upon checking, I discovered you added the plan B ID in the plan A, that's why it didn't work.I also recommend you place this style in your HTML head block so it hides the buttons by default when the DOM loads.
Then you can replace the script I sent you initially with this:
Hi everyone!
I have a peculiar situation where users on the basic plan are getting access to the content on the business plan, even if the attribute is used to gate the content from everyone, but the business members.
Question is if there is a way to block those users from getting access to that content besides the data-ms-content attributes?
Yes. Using the Dom front end library you could create a client-side validation to forcefully hide specific content with any condition that you want.
Is there a link to any type of documentation that I can read to learn more? 🤔
Yeah, that's how Memberstack work behind the scenes. It exposes the library so you can create your custom logic. All the methods are available in the Webflow package as well
https://developers.memberstack.com/docs/dom-front-end-package
I think you can ask MS bot to help you out with the scripting. i think there should be some snippets shared in this community or n the forums to help you with that. Here's one that you can use as an example https://memberstack.slack.com/archives/C033F0SLTLK/p1716914124678459?thread_ts=1716894256.902639&cid=C033F0SLTLK
If you have any particular question with your snippet you can paste it here to give you feedback
Thank you very much!
I'll go through it in the morning! Appreciate you
Please sign in to leave a comment.