This code snippet adds the ability to show and hide page elements based on a custom member status property. It works similarly to how the Outseta nocode module already lets you hide and show page elements based on the plan and more.
The code depends on a custom field with the system name MemberStatus
defined as a Person Custom Field with the control type set to CheckboxList, Select, or Text.
Copy and paste the code between <!-- ✨ Custom Snippet Start ✨ -->
and <!-- ✨ Custom Snippet End ✨ -->
from the demo below.
Then add the data-cf-member-status
attribute to the elements you want to control based on the member status. Use a comma-separated list of statuses that should show the page element:
<p data-cf-member-status="Accepted,Applied">
Only for MemberStatus = "Accepted" or "Applied"
</p>
The member status attribute may be combined with, for instance data-o-plan-content
.
<p data-cf-member-status="Applied" data-o-plan-content="L9Pxnp9J">
Only for MemberStatus = "Applied" and Plan = Pro Plan ("L9Pxnp9J")
</p>