Can I know how to detect user is in page editor mode using code? This is because, I have a component, when user browses from page editor, it will search in master_index folder instead of web_index folder.
相关问题
- How to pass “[Sitecore Mobile SDK] Data from the i
- How can I remove duplicated page events in Sitecor
- Spoof an IP address to test GEOIP lookups with Sit
- How to get a Multilist with Search field to not di
- Page.Header.Controls.Add(control) is adding contro
相关文章
- Sitecore set/change default language from 'en&
- Sitecore OMS - achieving a goal on a form submissi
- Get number of components in placeholder, Sitecore
- Sitecore text search in PDF or Word documents
- sending data from one sublayout to another in site
- The model item passed into the dictionary is of ty
- How to implement Solr into Sitecore
- Sitecore enables accessing child node around paren
Rather than checking the page mode, I think you just want to piggyback on the context database name -
I am using this syntax in view to add a class for JS detection, same code can be used for back-end detection with bit modification:
Please check with :
if (Sitecore.Context.PageMode.IsPageEditorEditing)
also is working on Sitecore 6.6, it not depends on Sitecore 7.
Please check also this Sitecore blog post by Martina Welander.
To check if is normal page use:
if (Sitecore.Context.PageMode.IsNormal)
To check if is preview mode use:
if (Sitecore.Context.PageMode.IsPreview)
Also are others PageMode:
If you are curious you can check with Reflector or dotPeek this class: Sitecore.Context.PageMode from Sitecore.Kernel assembly.