How to control button display logic for different subscription plans (monthly, yearly, lifetime) and guest users? Answered

Post author
Ruben Pueyo

Hi there,

I’m building a subscription site in Webflow. At the moment I have 2 family memberships with access to different content each. In the navbar in the homepage I would like to have a Dashboard button that is only visible once you are logged in. Is that possible? I have seen that with attribute “data-ms-content=!members” you can hide a button once people login,  but I want the contrary. I want to show a button when they login

Also, if possible, I would like that button to bring the users to the default page in Memberstack after they login (different for each family member). Is that possible?

In summary:

  1. Create a Dashboard button only visible to logged-in members
  2. Create a Dashboard button that brings logged-in members to the default page in Memberstack once they login.

I’m probably missing something and will appreciate if someone could guide me in the right direction.

Thanks

Comments

3 comments

  • Comment author
    Duncan from Memberstack
    • Edited

    This article is what you're looking for. https://docs.memberstack.com/hc/en-us/articles/7403036765339

    Show content if logged in

    data-ms-content=”members" → This content is visible when a member logs in… and hidden if they log out. This data attribute works with any Memberstack project.


    Show content if logged out

    data-ms-content=”!members" → This content is visible when a member logs out… and hidden if they log in. It’s handy for hiding elements that are annoying or redundant for logged-in members. For example, you can add data-ms-content=”!members” to your signup and login buttons to hide them when a member logs.

    Hope this helps!

    0
  • Comment author
    Mubassir Shaikh

    Hey Team!

    can someone help me solve this 3 usecase, how should i achieve this?

    I have 2 more use-case:

    1. Button will be visible only for yearly plan (pln_yearly-plan-4fbg0tlp)
    2. Button be be visible only for lifetime plan(pln_lifetime-plan-ykbh0tya)

    i tried using this attribute, but its not working

    Check this loom video: https://www.loom.com/share/bcd23e7ef4ca4a2f809ef438b8fe08c1?sid=29b804ef-96fa-4b10-bad0-7283a95bdab0

    0
  • Comment author
    A J

    Hey Mubassir Shaikh, you can do this by adding the following memberstack attributes to the buttons:

    Usecase 1: data-ms-content="paid-plans"
    Usecase 2: data-ms-content="!members"
    Usecase 3: data-ms-content="free-plans"

    You can find a guide on more such attributes here. Hope this helps.

    for this to work, you will have to create gated content for each plan and copy paste the content ID in the value field shown above. The linked guide should help you setup the gated content and it should solve your use-case.
     
    So like you have a gated content enabled for both yearly and lifetime plan, you need to have two separate gated content created and each should give access to only one kind of plan. Say you create a gated content for yearly plan, under allow access to specific plan, you need to select only the yearly plan. Now, copy this newly created gated content ID as the value for data-ms-content attribute that you have setup for the yearly button on the site. Follow the same process for the lifetime plan and you should get the results you are intending to have. 
     
    Hope this helps.
    0

Please sign in to leave a comment.