This article covers a Bloomreach Experience Manager version 12. There's an updated version available that covers our most recent release.

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/>
Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?