Conditional Visibility
Show/hide elements only for logged-in users.
You can show/hide elements only for logged-in users.
Warning
Is just a CSS solution, do not use it to “hide” sensitive data.
User is logged in
To show up an element only to logged in users, you just have to use the following custom attribute:
customer-conditionlogged-inUser is not logged in
To show up an element only to users that are not logged in, you just have to use the following custom attribute:
customer-conditionnot-logged-inUser is subscribed to mailing list
To show up an element only to subscribed users, you just have to use the following custom attribute:
customer-conditionemail-subscribedUser is not subscribed to mailing list
To show up an element only to not subscribed users, you just have to use the following
customer-conditionemail-not-subscribedCustomer is tagged by
Apply the following custom attribute on the element that you want to appear only and exclusively when the Logged in Customer Has a specific Tag/Tags
customer-taggedTagIn the case you wish to check different tags, just divide them by comma
customer-taggedTag 1,Tag 2By default the match is done by checking ALL the tags you indicated inside the attribute. You can modify this behaviour by adding the optional attribute
anytrueCustomer is not tagged by
Apply the following custom attribute on the element that you want to appear only and exclusively when the Logged in Customer Doesn't have a specific Tag/Tags
customer-not-taggedTagIn the case you wish to check different tags, just divide them by comma
customer-not-taggedTag 1,Tag 2By default the match is done by checking ALL the tags you indicated inside the attribute. You can modify this behaviour by adding the optional attribute
anytrueRedirect User
You can use custom javascript in order to redirect or prevent access to specific pages of your Webflow site. Smootify dispatches several JS events that allows a very cool dev extensibility.
For example, to prevent a page to be accessed from not logged in users you have just to copy and paste this script in the Webflow custom code Head section of that page.
Consider that pages inside the Account folder by default are already accessible only from logged in users.
<script>
document.addEventListener('smootify:user_auth_change', e => {
const user = e.detail;
if (!user) {
// Redirect
window.location = "/"; // Change "/" according to your own needs
}
});
</script>