The Visibility Conditions Feature - Otter Features Library
The conditional loading is a feature that applies to all blocks within the Otter Library and is represented by the Visibility Condition in the Settings panel.
It gives the user control of the visibility of the blocks based on the conditions inserted.
The feature can be accessed from the right sidebar under the Block Tools section. Click on the ➕ icon, then select the Visibility Conditions. A new accordion will appear, where you can configure the conditions.
Using the Feature |
Available Conditions |
🎥 Video - Exploring the Visibility Conditions |
🧰 Using the Feature
- 1
- To start the process, click on the Add Rule Group.
- 2
- From that point, you need to add conditions, so click on Add a New Condition.
- 3
- Select one of the conditions displayed there.
- 4
- An interesting fact is that a group can have multiple conditions simultaneously ( AND logical operation ).
- 5
- Navigate to the website and check if the condition works.
📝 Note: If you are not able to see the Visibility Condition, check in Dashboard > Otter > Settings and enable the . Visibility Condition Module
📝 Note: There can be many Rule Groups, but they will not be applied simultaneously, but one or the other ( OR logical operation ).
🔄 Available Conditions
There are a lot of options that you can choose from the dropdown:
Users conditions - related to the users' status:
- Logged In Users - the block will be displayed only for the users that are logged in.
- Logged Out Users - the block will be displayed only for the users that are logged out.
- User Roles - the block will be displayed only for certain users, such as administrators, editors, authors, and others.
- 📝Note: The user roles can be added by selecting them from the list.
- 💳 (PRO ) Logged-in User Meta - this block will be displayed based on the meta of the logged-in user, that can be added in the meta key field.
Posts conditions - related to post elements:
- Post Author - the block will be displayed if the post authors are the ones that you have introduced into the field.
- Post Type - the block will be displayed if the post type is one of the selected types ( e.g. post, page, product ).
- Post Category - the block will be displayed if the post is part of a selected category.
- 💳( PRO ) Post Meta - the block will be displayed based on the post meta condition.
- 📝Note: The meta key can be added in the blank field. In order to use this one, you should install the Advanced Custom Fields plugin, create such a field, copy its name and paste it into the Meta Key field.
Advance 💳 ( only for PRO users )
- Query string - the block will be displayed if the URL contains the specified parameters you add to the Query String field. Check this doc for more details.
- 📝Note: You can choose if the URL contains any or all parameters.
- Country - the block will be visible according to the country code you set.
- Cookie - block will be visible based on the PHP cookies you use to compare. Check this doc for more details.
Date & Time conditions - based on the time and date ( 💳 PRO only ):
- Date Range - the block will be displayed if the current date is between the start and end date ( optional ).
- Date Recurring - the block will be displayed on certain days, according to the ones picked by you.
- 📝Note: You can use the date recurring in combination with other date & time conditions.
- Time Recurring - the block will be displayed if the current time is between the start and the end time you introduce.
Stripe - based on the Stripe Checkout block.
- Purchase history - certain blocks can be visible or hidden based on the history.
There are some extra visibility conditions available for the PRO version that depend on the installed plugins:
WooCommerce conditions - related to e-commerce accessibility:
- Products in Cart - the block will be displayed if the user has certain products or products from certain categories in the cart.
- 📝Note: The product/category can only be added in the blank field by selecting them from the list.
- Total Cart Value - the block will be displayed if the total cart value is greater / less than the value established by you.
- Purchase History - the block will be displayed if the client's product history contains the products you inserted.
- 📝Note: The product can be added in the blank field only by selecting them from the list.
- Total Spent - the block will be displayed if the user has spent a certain amount of money ( greater / less than the value inserted by you ).
LearnDash conditions - related to learning:
- Purchase History - the block will be displayed if the product history contains the courses inserted by you.
- Course Status - the block will be displayed if the user has completed / not completed certain courses.