Help Center

Custom PHP Conditions

Custom PHP conditions allows you to use PHP to create unique conditions that may not be included in Oxygen’s default Conditions. This guide discusses how to use a custom PHP condition to hide content in Oxygen.

Setting the PHP Condition For a Template

  1. Click +Add Condition button when editing a template or element.
  2. Select the Custom PHP condition from the dropdown.
  3. Click the Open PHP Editor button.
  4. Add the PHP for the condition.
  5. Close the PHP Editor
  6. Click the Apply Conditions button.

When writing custom PHP, you will generally want the code or function to return true for when you want content to show, and false for when you want it to be hidden.

While the Oxygen Support team cannot help create custom conditions, here are some condition examples that may be useful:

Finalizing and Testing Conditions

After applying the condition, visit the page on the front end to see the conditions in action and verify that they are working correctly.