Sitecore Code Editor

Code Field Type

Sometimes you may want to use field types to contain html, javascript, or other types of data. Below is an example at how you can do that.

Beginning with the Sample Item template, add a new field using the code type.

image alt text

In our example, we can navigate to the Home item and see the new experience for the Code field.

image alt text

If you specify the theme and mode parameters in the source field you’ll see a more tailor experience. In this case I wanted to see the text formatted like css and using the textmate theme.

image alt text

Here we see that the css is validating that the rule is empty. The modes which support authoring validation are listed in the table down below.

image alt text