Skip to main content
Logo
There is a newer version of Contensis. Click to find out more and download the latest version.

Editor style dropdown menu

The editor style dropdown menu can be found in the editor toolbar when editing a page. By default the dropdown displays a list of all styles within the stylesheets assigned to the page template with a few exceptions:

  • It excludes all styles prefixed with sys_ or system_
  • It excludes all styles that are not classes
  • It excludes all classes with a pseudo class
  • It includes rules if the last part of a selector includes a class or the selector is just a classname

You can configure this further by updating the the project setting Editor_CssClassFilterRegularExpression. For example if you only wanted to display classes which start with usr_ then you would change the setting to /^(?!.usr_){1}.*$/  If you want to add multiple classes then use this instead: /^(?!.usr_)(?!.img_){1}.*$/

How does it style rules to give a representation of the original style

As the menu is in a different document to the content, we can't apply the style to the item in the dropdown menu. Nor would we like to, as you could have a margin or padding of 800px which could push the dropdown off the screen. Therefore we only apply a few of the properties in the dropdown, colour being the most obvious.

Structured content considerations

When you edit structured content the content you are editing is not in the context of your site markup. To help with this issue we only render out classes to the style dropdown which are part of editor stylesheets, this means that you can create a set of classes which match the names of your main classes but don't rely on context to render the correct styling.

As these styles are part of the editor stylesheet they won't render to the published page. Your normal site styling will be used instead once published.