In Content Editor, I select an Item and from the publishing tab, I select experience editor. Then the page opens in Experience Editor and the URL like this: wcm-example.com/?sc_mode=edit&sc_itemid=itemid
.
Now, the browsing URL of the item like wcm-example.com/item.html
I remove the query string and place item.html, still, it opens in Experience editor. How can I make sure that URL only with query string should open in Experience Editor and not direct WCM URLs?
-
Sitecore sets a cookie for the sc_mode value, which means if you are browsing the Experience editor this value will set for Experience Editor, and next time you will browse page using URL or item id it will browse it in Experience editor. You can run the URL in a separate browser or private window to run it as normal. Do you have any specific need for achive above feature? Current feature has its own benifits.– Mahendra ShekhawatCommented May 4, 2020 at 9:02
-
I was not aware of this. So where is this setting can it be edited through code?– DebaparnaCommented May 4, 2020 at 9:34
3 Answers
As mentioned it uses a cookie to say that this urls is on CM and show experience editor when you go to that on the same browser that you logged to CM.
One option to avoid that, is use a Incognito browser when you log in on CM so when you use the normal browser session it not will use the cookie.
- You can also use ?sc_mode=normal URL parameter to disable Experience Editor.
- Experience Editor also has a "Close" button (Home tab -> red Close button) on the Ribbon.
I would recommend using separate browsers. I use one for the sitecore shell and one for testing (i.e. firefox and chrome). I find this to be much less troublesome when it comes to cookies, etc. But that's my personal preference to avoid the issue. You can use incognito too.