How to create flexible CMS detail pages

In this guide, we explain how to use conditionals to create flexible CMS detail pages in Framer, enabling dynamic layouts that adapt to your content.

Controlling visibility using conditional logic “Is Set”

The simplest way to control visibility is with the “Is Set” condition. This checks whether an element (e.g., an image) is added to the page.

  • If an image is added, it is displayed.

  • If not, it remains hidden.

This approach requires no additional CMS fields and is ideal for straightforward use cases.

Shows the “Is Set” option in the “Set Variable” dropdown.

Other conditional options

Conditional logic also supports text-based criteria, such as:

  1. Equals

  2. Doesn’t equal

  3. Starts with

  4. Doesn’t start with

  5. Ends with

  6. Doesn’t end with

  7. Contains

  8. Doesn’t contain

These conditions let you check for specific text matches to control element visibility.

Controlling visibility using option fields

Setting up option fields

To add option fields in your CMS collection:

  1. Navigate to the CMS view.

  2. Click Edit Fields.

  3. Click the plus icon to add a new field.

  4. Select Option from the dropdown menu.

Create a list of options like “Show 1 Image” or “Show 3 Images” to customize visibility for each collection item.

Applying option field logic to designs

  1. Select the element whose visibility you want to control.

  2. Click the plus icon next to the Visible option.

  3. Select Set Variable and choose the Option condition.

Key options include:

  • Equal: Shows the element if it matches the selected option.

  • Doesn’t equal: Hides the element if it doesn’t match the option.

  • Convert: Enables control for multiple options and fallback behavior for unmatched cases.

Shows the Convert conditional transform modal.

Example: dynamic layouts with component variants

If you have a component with two variants—one showing three images and the other showing one—you can use the Convert option to select which layout to display for each option in the dropdown.

Using toggle fields for simple logic

For basic Yes/No conditions, use Toggle fields to control element visibility, such as showing or hiding an image.

Leveraging conditionals and transforms

Conditionals and transforms give you advanced control over CMS detail pages. You can apply conditions to any element with a plus icon, creating dynamic layouts tailored to your content. For more advanced techniques, watch this guide.

Still experiencing the issue after following the steps above? Create a support ticket in the Community.