Validate an item

Abstract

Check the spelling, markup, and validation of your items before you publish them.

Before you publish an item, you can run a few checks on the item to make sure that it is ready to be published.

This topic outlines how to:

You can check the markup of your webpages by sending all the HTML fields to a W3C HTML Validator.

To send all the HTML fields to a W3C HTML Validator:

  1. In the Content Editor or the Experience Editor, navigate to the relevant item or page.

  2. To check the markup of your webpages:

    • In the Content Editor, on the Review tab, in the Proofing group, click Markup.

    • In the Experience Editor, on the Home tab, in the Proofing group, click Markup.

The result of the check opens on a webpage, where you can see detailed notes and potential issues.

The Sitecore field validators are a set of user-input validators that can be applied to an item, a specific field type, or a specific field on an item.

The Content Editor validates the fields automatically. If there are fields that contain validation errors or warnings, a red bar appears to the left of the relevant field and in the validator bar, the icons change to red or yellow depending on the type of error. To see the details of the errors, move your mouse over the individual icons in the validator bar.

Validation errors in the Content Editor

In the Experience Editor, you can set up Sitecore to run the validation check on your pages every time you click Save:

  • In the Experience Editor ribbon, on the View tab, in the Enable group, click Field validation.

In this way, when you make changes to a page and click Save, the validation check runs through all the fields on the page. If there are fields that contain validation warnings or errors, the fields are highlighted with a color-coded dotted line according to the warning or error type and a notification appears with more details.

Validation errors in the Experience Editor

In the Content Editor and the Experience Editor, you can run the validation test manually and view the details about the validation test in the Validation Result dialog box.

To run a validation test manually on an item:

  1. In the Content Editor or the Experience Editor, navigate to the relevant item or page.

  2. To run the validation test on your item or page:

    • In the Content Editor, on the Review tab, in the Proofing group, click Validate.

    • In the Experience Editor, on the Home tab, in the Proofing group, click Validate.

In the Validation Result dialog box, you can see an overview of the results of the validation and suggestions for change. The possible values are:

  • Valid (green) – no action is needed.

  • Suggestion (yellow) – look into the issue and decide if an action is needed.

  • Warning (orange) – act on the issue.

  • Error (red) – this is an error.

  • CriticalError (red) – the warning appears before you save the changes.

  • FatalError (red) – you cannot save the item before the error is corrected.

    The Validation Results dialog box