DOCS

Restricting a page or template using Visibility rules

Sometimes, we need to restrict access to an entire page or template, based on various conditions.

For example, we might need to hide a page for logged out users, while keeping accessible for logged in users. In other cases, we might need to keep the page visible only for certain users such as those who have bought a membership plan.

How to restrict page or a template

As an example, we have this dashboard page called “My Listings” that we want to only display for logged in users as it has no purpose for logged out users.

To restrict this page, we go to Page settings by clicking the Gear icon at the top

Then in the Page settings area, we go to Voxel tab > Visibility

The first thing we have to choose is a primary condition which can be

  • Show if
  • Hide if

Once we pick a primary condition (we picked Show if in this example), we can press Edit rules to open the Voxel visibility rules UI

Here, we can create rule groups and add conditions inside them.

In this simple example, we need a single rule group and a single condition, to check if the user is logged in. So we press “Select condition” dropdown and pick “User is logged in” condition

Upon saving changes, we’re back to Elementor

Because we are restricting the entire page, the final thing we need to define is what is displayed when the page is restricted. In this example, we want to show the Login / Registration page, so we pick “Auth template” in the dropdown.

Continue reading