1) Introduction
We are excited to introduce the Test Mode Inspector, a powerful new feature that enhances your development experience by providing a detailed inspection of data attributes, errors, and warnings directly within your test mode site's. This guide will walk you through the functionality of the Test Mode Inspector and how it can streamline your workflow.
2) Accessing the Test Mode Inspector
The Test Mode Inspector can be accessed by clicking on the "Test Mode" badge, which appears at the bottom of your website when in test mode. This button is your gateway to a comprehensive diagnostic panel that lists all the unique data attributes, alongside any errors and warnings detected on your page. To close the Inspector Panel click on the "Hide Inspector" badge.
3) Using the Inspector Panel
Upon clicking the "Test Mode" button, a side panel will appear, containing the following inspector items:
- Found Data Attributes - Green
- Found Warnings & Errors - Yellow and Red
- X-ray View: At the top right of the side panel, you'll find an X-ray toggle. When enabled, it highlights the elements associated with the listed data attributes, errors, and warnings on the page, enabling you to visually track their locations.
4) Understanding Errors and Warnings
Errors and warnings are shown for individual items on the page, making it easier to pinpoint specific issues. The Inspector categorizes issues to help you prioritize fixes:
- Errors: Critical issues that may affect the functionality of your site or app and should be addressed immediately.
- Warnings: Potential issues or recommendations that may improve functionality, performance, or user experience.
Resolving the "Misplaced install code" Error
The Test Mode Inspector displays a "Misplaced install code" error when the Memberstack installation script is placed somewhere other than the global site head.
To fix this error in Webflow:
- Open Site Settings: In your Webflow project settings, go to Custom Code.
- Move the installation code to the Head Code section: Make sure your Memberstack installation snippet is placed in the Head Code section.
- Remove duplicate scripts: Check the Footer Code section in the Site Settings and any individual page settings under Page Settings → Custom Code and remove any duplicate Memberstack installation scripts.
- Publish your site: Re-publish your site and reopen the Test Mode Inspector. The error should clear once the installation code is correctly placed in the site head.
Resolving the "Unknown Content Value" Warning
The Test Mode Inspector displays an "Unknown Content Value" warning when an element uses a data-ms-content value that Memberstack does not recognize. This usually happens for one of two reasons:
- A custom word was used instead of a Content ID: Memberstack does not recognize custom values such as premium or !premium. To show or hide content based on plan access, first gate the content in your Memberstack dashboard, then use the Content ID generated for that gated content as your data-ms-content value.
- A built-in keyword was mistyped: Built-in keywords must match a supported value exactly. Common keywords include members, no-plans, free-plans, paid-plans, and verified. Each one can be reversed by adding an exclamation mark, such as !members.
To fix this warning:
- Locate the element: Open the Test Mode Inspector panel and click on the 'Locate' button inside the relevant warning section in order to highlight the element with the warning.
- Check the attribute value: In Webflow, open the element's custom attributes and review its data-ms-content value.
- Correct the value: Replace it with a built-in keyword or the exact Content ID from your gated content.
- Publish your site: Re-publish your site and reopen the Test Mode Inspector. The warning should clear once the value is recognized.
For the full list of supported keywords, see Show and Hide Individual Elements and All Webflow Package Data Attributes.
Resolving the "Misplaced Form Attribute" Error
The Test Mode Inspector displays a "Misplaced Form Attribute" error when a data-ms-form attribute has been added to the wrong element.
When you add a Form element in Webflow, it creates two nested elements: an outer “Form Block” wrapper and an inner “Form” element, which is the actual HTML form. Memberstack form attributes must be placed on the inner Form element.
To fix this error in Webflow:
- Open the Navigator: In Webflow, open the Navigator panel and expand the Form Block.
- Select the inner Form element: Click the Form element nested inside the Form Block.
- Add the attribute: Open the Settings panel (keyboard shortcut D) and, under Custom Attributes, add the correct data-ms-form attribute, such as data-ms-form="signup" or data-ms-form="login".
- Remove the misplaced attribute: Select the outer Form Block and delete the data-ms-form attribute from it.
- Publish your site: Re-publish your site and reopen the Test Mode Inspector. The error should clear once the attribute is on the correct element.
5) Test Mode Inspector Visibility
It's important to note that the Test Mode Inspector is only visible when your site is in test mode. It will not appear on live apps or websites to ensure a clean user experience for your visitors. Additionally, if you find that the Inspector sidebar is obscuring content on your page, you can click the "Switch Sides" button to toggle the sidebar to the other side of your screen. This ensures that you can always access and view the entirety of your content without interference from the Inspector panel.
6) Conclusion
The Test Mode Inspector is designed to make your testing and development process more efficient by providing immediate, on-page diagnostics. By integrating this feature into your workflow, you can ensure a higher quality product with a smoother path to deployment. If you have any ideas on how to make this Test Mode Inspector better please let us know!
Comments
1 comment
My website is in live mode but the Test mode icon appears for users. How do I resolve please help
Please sign in to leave a comment.