AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    InstallationUsing the Xperience interfaceDeveloping websitesConfiguring XperienceManaging usersSecuring websitesDeploying websitesManaging website contentMultilingual websitesMacro expressionsExternal utilitiesIntegrating 3rd party systemsCustom developmentE-commerce featuresOn-line marketing featuresRelease notes - Xperience 13Xperience terminology glossary
  • Tutorial
    Using the Xperience interfaceDeveloper tutorialBusiness tutorialResource hub for marketers
  • API Examples
    ConfigurationContent managementDevelopmentE-commerceOn-line marketingSocial media
  1. Home
  2. Custom development
  3. Extending the administration interface
  4. Configuring the code editor

Configuring the code editor


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

The interface of Xperience contains areas where users can enter code that defines the appearance or behavior of websites. The code fields use an editor that provides syntax highlighting and other features to help website developers write and maintain sections of code.

Highlighting ensures that text elements are displayed in different colors depending on the syntax of the given language. Syntax highlighting improves the readability of code and makes it easier to spot and avoid mistakes. All languages commonly used for web development are supported, including HTML, ASPX markup, CSS, JavaScript, SQL, XML and C#. Each language has its own set of highlighting rules for code formatting.

In addition to syntax highlighting, the editor also provides other types of functionality:

  • Show/hide line numbers – enables or disables the panel that displays line numbers.
  • Toggle fit-to-window mode – toggles the editor between its normal size and an expanded editor covering the entire window (frame).
  • Show hide/bookmarks – enables or disables the bookmark panel on the side of the editor. Only available for CSS code by default.
  • Undo (CTRL+Z) – removes the last change made to the code in the editor, restoring it to its previous state. The editor stores the history of changes, so you can use the Undo action multiple times.
  • Redo (CTRL+Y) – reverses one previously made Undo action.
  • Search – opens a dialog that allows users to search the code in the editor for a word or phrase.
  • Replace – opens a dialog that allows users to find a word or phrase and replace it with the entered text.
  • Edit source – opens a resizable dialog where the code can be edited without syntax highlighting or any other advanced functionality.
  • Indent all – sets the indentation of all code in the editor according to the conventions of the given language.
  • Insert macro – allows you to add macro expressions in to the code.

The panel on the right is an alphabetical list of bookmarks that allows users to jump to marked sections in the code. You can insert bookmarks using code blocks (regions) following the syntax of the currently edited language, for example /* #<bookmark name># */ for CSS.

Customizing the syntax highlighting

You can modify how the code editor applies colors and other styles to various syntax tokens of individual languages:

  1. Open the ~/CMSAdminControls/CodeMirror/theme folder in your administration project.
  2. Edit the cms.css stylesheet.

Disabling the advanced code editor globally

You can adjust the behavior of all code editors in the administration interface by adding the following keys into the /configuration/appSettings section of your administration project's web.config file:

Web.config key

Description

Sample value

CMSEnableSyntaxHighlighting

Globally enables or disables the code editor and syntax highlighting support for all code fields in the administration interface. You can disable the editor if it is causing performance issues or other problems.

The default value is true.

XML
<add key="CMSEnableSyntaxHighlighting" value="false" />

CMSEnableSyntaxHighlighting.<Language>

Allows you to disable the code editor and syntax highlighting support for fields that display code in a specific language. Replace <Language> in the key name with the name of the language that you wish to disable. The following language options are available:

  • Text
  • HTML
  • CSS
  • JavaScript
  • XML
  • CSharp
  • SQL
  • HTMLMixed
  • ASPNET
  • CMSSharp

All languages are enabled by default.

XML
<add key="CMSEnableSyntaxHighlighting.CSS" value="false" />

On this page

  • Customizing the syntax highlighting
  • Disabling the advanced code editor globally