This might come off as a bit obvious, but chances are it might be news to some people; Previewing content in Sitecore is dull. There, I said it. It takes a couple of clicks to get your page previewed (Hit the Publish tab and then Preview button). While this is not really a big issue, content editors find it time consuming (and a bit confusing).
As always with Sitecore, there are more ways than one to
skin a cat preview content!
The Context Menu Approach
A quick, and simple way is to add an option to the content tree context menu, here’s how:
- Head over to your Core database (and as always, handle the Core database with care)
- Expand to the following path: /sitecore/content/Applications/Content Editor/Context Menues/Default/
- Create a new child called Preview (mine is directly below “Insert”), based on the MenuItem template (located in /sitecore/templates/System/Menus/Menu item)
- Set the following fields:
Display name: Preview
Message (under the Data section): item:preview(id=$Target)
Now, switch back to your Master database and right click any item in the content tree and hit the new Preview option.
Bonus: Auto Preview Content in Content Editor!
Another quick way to preview content is to add the preview “Editor” to items. Here’s how:
- Go to the __Standard values of the template item
- Enable “Standard Fields” (Hit View > Check Standard Fields in the Ribbon)
- Scroll down to Editors in Appearance section of the template and hit Edit button.
- Select the “Preview” editor (it’s under Item Editors > Preview) and select it (by double clicking or highlighting and clicking arrow right button)
- Preview any content based on this template automatically when the item loads in the Content Editor.
(Hint: Define a base template for all items that render as web pages and assign the editor there, then inherit this template for all page items for automatic preview everywhere).