Detection problems when we do CMS Preview vs Dynamic Preview in 2012 UI / XM

I have a template code (2011 SP1) that determines if CMS preview was used by checking engine.RenderMode (which would be PreviewDynamic ). This would ensure that the material that is typically added by the application server for published pages (e.g. CSS, JS, navigation elements, etc.) is injected into the processed output, so the preview looks good in the CMS.

Tridion 2012 UI / XM creates temporary files for dynamic preview, and it turns out that when these files are published, the rendering mode is also PreviewDynamic , which creates a problem for me, as in a situation where the page is actually published, I do not want to enter things (the application server takes care of this with the .NET homepage in this case)

Considering the possible values ​​for RenderMode in the .NET API, we have Publish , PreviewStatic and PreviewDynamic .

So my questions are:

  • How can I talk about the difference between CMS Preview and DYnamic Preview in a code template
  • When (if at all) is a RenderMode PreviewStatic ?
+4
source share
1 answer

I have a partial solution (for the first question). If you use a combination of RenderMode and engine.PublishingContext.PublicationTarget , you may find CMS Preview vs Dynamic Preview vs Normal Publish:

  • CMS Preview - RenderMode: DynamicPreview PublicationTarget: null
  • Dynamic view - RenderMode: DynamicPreview PublicationTarget: not null
  • Normal Publishing - RenderMode: Publish PublicationTarget: not null

Not sure if PreviewStatic is used though ...?

+5
source

Source: https://habr.com/ru/post/1440229/


All Articles