How to show all CMS collection items on one page while gating individual content based on user membership plans? Answered
Hi, is there a way to show all the content from a cms collection on an index page, but gate individual items based on the user's plan? I want the user to be able to see all locked content as an incentive to upgrade.
Comments
6 comments
I would say use JS to do something like:
If users plan is Paid Member button link = item url.
If users plan is Free and item is Premium, then button link = upgrade plan page.
Another alternative method that I used for a use-case is via collection fields.
You can have a field in your collection which stores if the user has access to such data or if you already store such parameter like plan of the user in CMS.
You can then create 2 section, one is unlocked content and another a locked content. Both of which can be controlled in terms of visibility based on the parameter which has the plan information or as applicable for your use-case.
I like that A J that's smart thinking. That's actually very useful for a variety of use cases.
Thanks Michael Cooper, came up with this idea while working for a client 🫤
Thanks A J - this sounds like a good possible solution. Ideally, I’d like to have all the media in the same section instead of splitting the content out.
Originally I assigned the data-ms-content value to each of the content types, which worked as far as gating the content, but that hid them from the list.
Jeff Harmon Yes, I understand. I had tried the data-ms-content attributes too.
So essentially with my method, you can just create a placeholder kind of second section which does not have media items as such but can be a static section which shows that the user needs to upgrade in order to get access.
With some tweaks from my end, I was able to provide a consistent look to a dashboard, which does not let the user see it as 2 different sections but just one block of items, few for which they have access and few which they need to upgrade for or complete some tasks as such like drip content. The 2 section is just known in the development stage to me and not to the end-user.
Please sign in to leave a comment.