App Modes
Modes in the Webflow Designer
The Webflow Designer is a powerful collaborative tool for teams to design and build websites quickly and at scale. To support collaboration, the Designer offers various modes to support different aspects of the design process:
- Designing and Building: Designers can create and refine the website’s layout and appearance in the Webflow Designer, while marketers and content writers manage and update content in build mode.
- Page Branching: Multiple designers can work on different pages of the same site at the same time, allowing for parallel development and reducing bottlenecks.
- Localization: Global teams can create customized experiences for different languages or regions, enabling global reach and tailored content for diverse audiences.
Through these features and modes, the Webflow Designer determines the specific actions a user can take to ensure teams make the right updates at the right time.
Modes in Webflow Apps
Designer Extensions extend the user’s capabilities while respecting the mode the Designer is in. Each method in the Designer API offers distinct functionality, aligning with the actions feasible in each mode. By understanding the various modes in the Designer, and how Designer APIs interact with them, you can ensure your App functions correctly across different contexts within the Webflow Designer, thus providing a seamless user experience.
Understanding modes and API methods
Each API method’s documentation includes an “App Modes” section that outlines where and how the API can be used, as well as any limitations.
Here’s an example from the “Remove Element” method:
In this example, the “Remove Element” method can only be successfully called if the user is in design sitemode, working on the canvas in a primary locale on the main branch. If the user is in any other mode, the API will throw a “Forbidden” error.
See below for a complete table of abilities, which defines where and how an API method can be used.
Checking for App modes with webflow.canForAppMode
To ensure your app functions correctly in the different modes of the Webflow Designer, you can leverage the webflow.canForAppMode
method. This method allows you to check whether a specific action is allowed in the user’s current mode before executing it, helping to prevent errors and improve the user experience.
Example Usage
The webflow.canForAppMode
method returns a Boolean indicating whether the specified action is permitted based on the current mode of the Designer. Here’s a basic example:
When to Use webflow.canForAppMode
Use webflow.canForAppMode
before any critical action that depends on the mode the user is in, such as:
- Adding or modifying elements in the Designer.
- Creating or editing styles that are only permitted in specific locales or branches.
- Managing components that might be restricted based on the current workflow.
See the documentation for webflow.canForAppMode
for more details.
Error handling for App modes
When an API call is made in an incorrect mode, a “Forbidden” error will be thrown. To manage this, implement error handling to guide users back to the appropriate mode. For more guidance on errors, see our guide on understanding and handling API errors.
To help you implement robust error handling for App Modes, we have included a list of API abilities along with the accepted modes for each ability and example error messages to direct users back to the correct mode:
As an example, see the below snippets on guidance for how to catch the new Forbidden
error and surface appropriate user messaging.
Before App Modes
After App Modes
Testing with App Modes
To test out how your Designer Extension will function with Expanded App Modes, you can opt-in to the feature with your webflow.json
manifest file.
Now, if you launch your Designer Extension from the Apps Panel as you normally would today, you can switch to Build mode, as an example, and your App should remain open. If you take an action via your App that a user shouldn’t be able to in that mode, you will see a Forbidden
error thrown, and you can catch the error appropriately to surface relevant user messaging.
Opt Out
We recognize that for some Apps, it may take more time to incorporate code changes to add extra error handling, UI considerations, etc. with expanded App Modes. To opt-out, set the expandedAppModes
feature flag to false in your webflow.json
manifest file (see below). Then, simply create a new updated app bundle with this change and submit it for review.
Deciding to Opt Out
Opting-out of this feature means your App will only be able to be launched under the existing conditions; end-users who are Designing in the primary locale and main branch. Additionally, your App will not be launched from the Apps panel of the Designer by users who don’t meet those conditions (i.e,. in build mode).
Designer v1 APIs
If you have an App using Designer v1 APIs, your app will not be able to be launched in other modes around the Designer, and will continue to only be launched when Designing in the canvas in the primary locale and main branch.