When using the JSS Layout Service with my Angular application, I notice that if I add personalized content to my component, the response (and display) I get back from the Layout service depends on a certain flag. [{pageEditing: true, site: {name: "portal.local"}, pageState: "normal", language: "en"}]

If this value is false, my personalization seems to work. If true, it shows some generic HTML content (code). I notice I can control this flag by logging out of the Sitecore instance.

Is there a programmatic way to always request the pageEditing=false version from my app? I understand that the experience editor needs to show the content so it needs to handle both. Thank you.

This behavior is due to being logged into Sitecore and browsing your JSS app in the same browser instance (even if they're separate tabs they share cookies).

I would suggest browsing to your app in an incognito window or separate browser.

Related question: Layout API returning strange code into placeholder

  • Perfect...company policies do not allow incognito windows but a separate Edge browser did the trick. Thanks for the extremely quick response Adam! – Toby Nunn Oct 24 at 18:40

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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