🎭 Conditional Visibility

Very often, you will want to display or hide data based on the user’s profile and interactions.

For example, you might want to:

  • gate content based on user roles
  • filter a collection based on who is logged in
  • display a message after a user does something
  • hide collection items that don’t meet certain criteria
  • highlight an item that was selected by the current user

Here are some short tutorials on how to do that

Display button if user is logged out

In the tutorial below, we use the "isAuthenticated" variable to determine whether to display a Login or Logout button:

Filter a collection based on who is logged in

In the example below, we are using the Auth0 for authentication. However, the logic and variable would be the same if you were using another authentication plugin.

Display a form success message

Hide item that doesn’t have an image

Highlight items selected by the user

Last modified on

April 29, 2022