Original Article Content
This is mostly obsolete based on the changed described above.
In general there are three categories of users who will be using your Webflow-Memberships-based site;
- Public users, who are not logged in, aka "Anonymous" users.
- Logged-in users, regardless of the access groups they have access to
- Access-group users, who have specific access-group permissions
As of Dec-2022, there is no difference in the search results experience between what these three user groups can see. If all 3 users do the same search, they'll all get the same results, including private pages. What they won't
So far, we've used three approaches, for different clients.
Approach #1 - Show no results at all
Just disable site search.
While this isn't the ideal solution for many clients, in case where privacy needs are high, and/or most of your site is private anyway, it might be the best approach.
Unfortunately there currently is no way to restrict the site search page to logged-in users only.
Approach #2 - Show all results to everyone
This is ideal if you have a paid membership site which has a content-driven marketing strategy. Those results are part of your marketing strategy, and you want people to click them and encounter the paywall.
Users will see those results but be confronted with a log-in / sign-up screen when they try to access it.
If you want to improve that UX, you can mark gated content specially in the results.
Approach #3 - Hide member-only results for everyone
This is good if the gated content is "private" and you don't want the public to even see the page titles.
Yes, this makes search useless for logged in users but you can build other good dynamic views for them.
Approach #4 - Hide sensitive member-only results
Webflow allows you to include/exclude specific pages and collection pages from site search results.
Remember, Site search does have the ability to index and excerpt your secure pages, so there's a chance those results could be shown in search results.
If you have highly sensitive pages, that you cannot risk people seeing, simply exclude those collection pages completely.
Approach #5 - Build dynamic "smart" results
This is the hardest approach to setup, but arguably the coolest.
You can determine log-in/log-out state using Webflow's conditional visibility feature on your HTML Code Embed, or if that's problematic, use Sygnal's Current User Info library.
Then, use custom code to examine the URLs paths of the pages in your results, and show only the ones the current user should see.
Conveniently, Webflow has a very strict URL architecture;
- Up to 100 static pages
- Up to 20 collection-list pags, which are identifiable by /collection-slug/
Yes this means maintaining a list in code, but unless you're changing your site's security setup often, it should be relatively stable.