Detect Preview or CMS Request Context
In your template, you might want to only include some HTML if the request is for a preview version of the site, or when the request is from the Channel Manager.
You can check this in your JSP template as follows:
<hst:defineObjects/> <c:set var="isPreview" value="${hstRequest.requestContext.preview}"/> <c:set var="isCmsRequest" value="${hstRequest.requestContext.cmsRequest}"/>
or in Freemarker:
<@hst.defineObjects/> <#assign isPreview=hstRequest.requestContext.preview/> <#assign isCmsRequest=hstRequest.requestContext.cmsRequest/>