Enabling normal view to non Sitecore users to review changes before publishing the actual changes to production site – preview publishing target
Sometimes, we got requirements from client that some of their executives will also required to review the site changes before publishing it to live site, and upon that those executives will be non Sitecore users. In this case we need to enable normal view mode for non Sitecore users so that they can review changes before reaching to final state of workflow to publish to public site.
Sitecore has introduced a feature called Preview Publishing Target which allows us to publish the items to that specific target ignoring in which state of workflow an item is.
Let’s create a Preview Publishing Target and enable normal view for the non Sitecore reviewers step by step:
- Create a copy database of web. We have named it here preview_web.
- Add connectionstring in App_Config/Connectionstrings.config with above specified name preview_web.
- Add database node in App_Config/Sitecore.Config <databases> pointing to above database preview_web.
- Add new publishing target to /sitecore/system/Publishing targets/
- Check Preview publishing target check-box as shown in above image
- Publish this item to both the target web and preview_web.
- Go to workflow used in your site -> select state -> select the preview publishing targets from the list as shown below:
- Do the same steps for all the necessary workflow states.
- Publish the workflow with subitems.
- Now accessing item which is using above workflow, you can see the note as shown below:
- Now add a new site in site definitions in ~/App_Config/Sitecore.Config
<site name="previewsite" hostName="scpreview" enableAnalytics="true" enableTracking="true" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/homepage" database="preview_web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" cacheRenderingParameters="true" renderingParametersCacheSize="10MB" />
- Add bindings and host entry for above demo host
- Now, make changes, publish changes to both web and preview_web instances before submitting or approving in final workflow state, changes will be visible in the above preview site. While live site will remain unchanged.
- As above domain will also be live (public) domain anyone having this link can view the site, while it should be only available for the needy person who are going to review.
- To enable security on this production site on preview_web follow below blog posts:
- Also make sure you only apply security restriction to preview_web database not to the web database.
Hope this will help you in implementing similar scenario.