Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit b4d8da9

Browse files
committed
Updated documentation about the preview
1 parent 7ca295b commit b4d8da9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/developers-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ Because we treat your data as a standard `IPublishedContent` entity, that means
139139

140140
#### Rendering Alternative Preview Content
141141

142-
If your front end view is rather complex, you may decide that you want to feed the back office preview an alternative, less complex view. To do this, within your Razor view/partial, simply check for a querystring parameter `dtgePreview` being set to "1" to detect being in preview mode to provide an alternative view.
142+
If your front end view is rather complex, you may decide that you want to feed the back office preview an alternative, less complex view. To do this, within your Razor view/partial, check for a RouteData parameter `dtgePreview` being set to true to detect being in preview mode to provide an alternative view.
143143

144144
```
145145
@inherits Umbraco.Web.Mvc.UmbracoViewPage
146-
@if (Request.QueryString["dtgePreview"] == "1")
146+
@if (ViewContext.RouteData.Values["dtgePreview"])
147147
{
148148
// Render preview view
149149
}

0 commit comments

Comments
 (0)