1

I have a Sitecore 9.1 MVC implementation where I want to consume the layout service response from a different Sitecore endpoint as an rendering.

I have gone through the ways mentioned in Sitecore documentation about adding Javascript Rendering and Client side embedding in an existing Sitecore MVC implementation. But for both of these, the data has to come from the same Sitecore instance.

Please let me know if any approach is available to achieve this requirement.

3
  • The Sitecore JSS work in the Context of Same instance it means your JSS rendering will embed in the same instance. In this case you have to create Reactjs based or other js framework based app which will internally consume Layout service and required parameters to render the ReactJs component can be passed from cshtml file of rendering.
    – Amit Kumar
    May 29, 2020 at 20:33
  • So you mean to say that I have to call a javascript function when the view or controller rendering component loads and from that js function call Layout service endpoint of the other sitecore instance? what if I use Javascript rendering and then use a custom contents resolver to call the other sitecore endpoint and pass the data back?
    – Anandarup
    May 30, 2020 at 10:32
  • No. First thing you have to create Reactjs components by using your Sitecore instance One which independly run by adding supporting JS e.g. ReactDOM.render(<Car />, document.getElementById('root')); here Car is component and to run this required ReactJs Framework files needs to be added. This component should have service call internally which makes call to your other Sitecore instance layout. It means ReactJs component will need to embed into MVC view and it will connect internally with other Sitecore instance layout service. And do not need to create custom content resolver for this
    – Amit Kumar
    May 30, 2020 at 15:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.