I have a page whose menu bar loads fine when previewed by clicking Presentation > Preview.

When previewed by clicking Publish > Preview, the site's menu bar is overlapped by Sitecore menu.

To fix that, I want to add a margin-top css property for the menu bar when it is being previewed using Publish > Preview.

How can I do that, as for both the methods, the page mode is Sitecore.Context.PageMode.IsPreview


Presentation-preview is designed for Content Editor Users, Publish-preview - for Page Editor users. This is the main concept difference, in my opinion. Technically they use different engines: the presentation-preview uses the one inherited from old 5.3/6.0-6.3 versions, and the publish-preview uses Page Editor Engine invented in 6.4 versions.

Publish -> Preview also provides other options such as allowing you to choose the device while previewing. On the other hand, Presentation -> Preview uses the first device that has "Default" field checked under the /sitecore/layout/devices item

So my suggestion is to forget to use Presententation -> Preview , recommended practice in Sitecore is to use Experience Editor not Content Editor for editing pages.


Presentation Tab Preview runs in the context of your "website" site & Preview from Publish runs based on your site definition & hostname entry. Also you can check the URL triggered while accessing like below:

Presentation Tab: http://?sc_site=website&sc_lang&sc_mode=preview Publish Tab: http://?sc_itemid=&sc_mode=preview&sc_lang=


The Request.Url looks like below if you are in presentation->preview


The Request.Url looks like below if you are in publish->preview


the main difference i spot is


based on that we can find whether we are in presentation preview or publish preview

var previewtype = Sitecore.Context.PageMode.IsPreview ? Request.Url.PathAndQuery.Contains("uri=sitecore") ? "presentation-preview" : "publish-preview" : "not-previewMode";

You can check whether the page is in Preview mode inside the navigation component and add z-index or margin depending on your solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.