bloomreach / spa-sdk

Apache License 2.0
15 stars 16 forks source link

isPreview - BRE 14/15 isChannelManagerPreviewRequest() vs BRE 14/15 isPreview() #33

Open zcher82 opened 4 months ago

zcher82 commented 4 months ago

upgrading from BRE 14 to 15, I noticed that components we were hiding using page.isPreview() is now showing up on live preview site, as opposed to previously ONLY showing up in experience manager (BRE 14).

HstRequestContext in BRE 14 & 15 provide two distinguishing 'isPreview' methods: https://xmdocumentation.bloomreach.com/library/concepts/channels/jsp-code-to-find-out-whether-a-request-is-a-preview-or-cms-request.html.

I believe isPreview returns !!this.model.meta.preview;. what exactly is model.meta.preview reading from BRE? How is it being set? is it set with HstRequestContext isPreview or isChannelManagerPreviewRequest? or is the value set a different way? is there a different method that i missed that would be more precise than page.isPreview?

the goal is to display my component in Experience Manager Preview, but NOT in live preview pages. thanks