How to show CMS content based on logged-in user email in Webflow with search and filter options?
Hi there - I'm looking to build a table (webflow cms) that only displays the cms content relative to whoever is logged in (i.e. only display table content that I have permissions to). This seems achievable via the "show content if logged in with plan" logic outlined in this post.
My question is, is this a feasible approach if the user will also want to search/filter the given content that they have permission to? We may have 25+ different users (plans) and each user may have hundreds of cms records to view/search/filter. This is mostly a sanity check before I go down the route of implementing.
Thanks in advance.
Comments
8 comments
Julian Galluzzo have we found solid solutions to implementing this? I'm wondering if your recent project using Finsweet filters might help? I.e. filter on the ID in a hidden field.
Yes indeed! You can use this and it will only filter through the content they have access to. https://webflow.com/made-in-webflow/website/saved-finsweet-filters
Thanks Julian Galluzzo! Could you help explain how this is working or how to implement on my own table? Apologies, I'm not getting what was done differently here by looking through designer.
Hey everyone, Is there a way to filter CMS items by the logged-in user's email?
I have a CMS item that has data from all the user's and I want to show that data on a single page/table, but each user should only see their own data.
The ideal scenario would be if I could use their login email to create the filter/conditional visibility.
Hey Waqar Naqshbandi, you can take inspiration from this memberscript to show relevant CMS items for the current logged in user and preferably remove the CMS items which are not relevant by customizing the memberscript shared.
However, an easier and a bit more secure approach would be (if that seems fit for your use-case) to make use of member-specific pages via CMS collection templates that Webflow creates automatically for each collection. Hope this helps
Hi, I used a different approach:
Why I used this method? Because the #44 script just change the css display to 'none'. So if there are a lot of records, issue will come like heavy loading. Also I want to make the data of user confidential from other user, so I dont want they can see the data on html.
Another approach, you can also use Memberstack Json to store the data of users, then use javascript to read Json and display on Webflow.
Hey Huy Khiếu, glad you found a workable solution. I would like to ensure that you are not exposing any of your API keys in the client-side code as its not a secure approach to apply.
That being said, yes if its confidential data, rather than hiding it, its best to remove the element from the DOM as stated earlier and yes you could use Member JSON if it fits your use-case as well.
Im using wized to handle that
Please sign in to leave a comment.