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.
Other conditional options
Conditional logic also supports text-based criteria, such as:
Equals
Doesn’t equal
Starts with
Doesn’t start with
Ends with
Doesn’t end with
Contains
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:
Navigate to the CMS view.
Click Edit Fields.
Click the plus icon to add a new field.
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
Select the element whose visibility you want to control.
Click the plus icon next to the Visible option.
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.
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.