Where can I usually mock (for JSS disconnected mode) additional layout service data that I put into the layoutservice response by a "JssGetLayoutServiceContextProcessor".

So if I add additional context data like canonical links urls to the output like (see languageSwitch) :

"sitecore": {
               "context": {
                   "pageEditing": false,
                   "user": {
                       "domain": "sitecore",
                       "name": "admin"
                   },
                   "site": {
                       "name": "JssReactWeb"
                   },
                   "pageState": "normal",
                   "language": "en",
                   "languageSwitch": {
                       "de": "http:\u002F\u002Fmyweb\u002Fde\meineseite",
                       "en": "http:\u002F\u002Fmyweb\u002Fen\mypage"
                   },

               },

See: In disconnected-mode-proxy.js:

const proxyOptions = {
  appRoot: __dirname,
  ...,
  customizeContext: (context, route, currentManifest, request, response) => {
    context.languageSwitch = { ... }
  },
};

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.