Hi! I have a custom login with two labels possible, “Client Acc” and “Freelancer Acc”. Is there any way I can restrict a page using these labels? What I had in mind is to add another member page just like below (Client Page and another one for Freelancer) and that I would hide the other page base on the label. I tried searching here on the forum but I found nothing. Thank you!
You might want to look at creating member roles for your website as this would be a much easier way of working for you.
https://support.wix.com/en/article/creating-member-roles-6943237
https://support.wix.com/en/article/managing-your-member-roles
https://support.wix.com/en/article/limiting-pages-on-your-site-to-specific-members-member-roles
https://support.wix.com/en/article/changing-the-permissions-of-a-member-role
if you want to stick with your custom labels in your Contacts List like here.
https://support.wix.com/en/article/adding-labels-to-contacts-in-your-contact-list
Then you will need to query the Wix CRM for all the contacts with the label of Client Acc or Freelancer.
label = [“Client Acc”];
label = [“Freelancer”];
Please note though that all site members will be using the Wix Users API, whereas only people who have contacted you for example will be using the Wix CRM.
What’s the difference between wix-crm and wix-users?
The CRM API contains functionality for working with your site’s contacts.
The Users API contains functionality for working with users who are logged-in members.
Note that all members are also contacts, but contacts are not necessarily members.
For more info on Wix CRM and Wix Users, please see the API reference.
https://www.wix.com/corvid/reference/wix-crm.html
https://www.wix.com/corvid/reference/wix-crm-backend.html
https://www.wix.com/corvid/reference/wix-users.html
https://www.wix.com/corvid/reference/wix-users-backend.html
Finally, you can see more on this page too if you have a good read of it.
https://support.wix.com/en/article/corvid-working-with-the-data-api