2

I am new in XM cloud and just started working on it. I would like to add new component in XM cloud just like a SXA component. I do this in SXA by creating a controller rendering and inside the rendering I provide code reference (MVC code : controller name and index name).

How can we achieve this scenario in XM cloud?

I tried to find the way on internet but have not found any relevant articles for creating controller renderings in XM Cloud.

4
  • Have you done the xmc training? It sounds like this would benefit you a lot.
    – Richard Seal
    Commented Jul 29 at 12:54
  • @RichardSeal not yet. Could you please share the link if you have ?
    – Ashu
    Commented Jul 29 at 15:37
  • learning.sitecore.com/learn
    – Richard Seal
    Commented Jul 29 at 20:25
  • The short answer is, you can't do what you are trying to do. XM Cloud is Headless only, you need to learn how to do headless development with XM Cloud and JSS/Next.js. This is prerequisite to using XM Cloud.
    – Richard Seal
    Commented Jul 29 at 20:27

5 Answers 5

3

XM Cloud enables headless architecture and provides a front-end application for site delivery. It doesn't include a Content Delivery component, which means you can't create controller renderings in the same way as you would with Sitecore Experience Accelerator (SXA) when using XM Cloud.

In XM cloud Headless JSS implementation, you need to create component. Steps for Building a simple custom component are

  1. Create a JSON component item with a data source template and a rendering parameters template.

  2. Create a default variant for the component that renders a text field.

  3. Create a component file for your front-end JSS app that corresponds to the component item defined in the Content Editor.

  4. Add base templates to the parameters template of your component to ensure that the component supports the functionality you need.

Hope this help, thank you!

1

XM Cloud, Sitecore's cloud-native platform, doesn't support controller renderings. Instead, it embraces a headless architecture using the Sitecore JavaScript Rendering SDK (JSS) for front-end development. This shift offers enhanced flexibility, scalability, and performance over traditional MVC-based approaches.

In XM Cloud, content is delivered as JSON data, consumed by front-end frameworks. This method diverges from controller renderings, which are tightly integrated with the MVC pipeline. If you're planning to move to XM Cloud from a system using controller renderings, you'll need to transition to JSS. This involves:

1.Developing JSON renderings

2.Creating JSS components

3.Integrating these with XM Cloud

For detailed guidance on creating JSON renderings, consult the official Sitecore documentation.

0

XM Cloud supports headless implementation and has a front end application to serve site. There is no Content Delivery component here. So you can NOT create a controller rendering like SXA with XM Cloud.

Please read below para from this article https://developers.sitecore.com/learn/faq/xm-cloud/sxa

Will XM Cloud support existing MVC/SXA solutions?

XM Cloud does not have Content Delivery servers therefore it will not support the rendering of MVC/SXA solutions. 

You can also refer architecture from this page for better understanding. https://developers.sitecore.com/learn/getting-started/xm-cloud-introduction

You will need to create Json Rendering as mentioned by Manoj in other answer.

Hope this helps !

0

Controller renderings are not supported in Sitecore XM Cloud. XM Cloud is designed for a headless architecture, leveraging the Sitecore JavaScript Rendering SDK (JSS) for front-end development. This approach offers greater flexibility, scalability, and performance compared to traditional MVC-based controller renderings.

XM Cloud focuses on delivering content as JSON data, which is consumed by front-end frameworks. Controller renderings are tightly coupled to the MVC pipeline, which doesn't align with this approach.

If you're currently using controller renderings and considering XM Cloud, you'll need to migrate to JSS.

  1. Creating JSON Renderings.
  2. Developing JSS Components.
  3. Integrating with XM Cloud.

You should refer to Sitecore documents to learn more about how to create JSON Rendering.

Hope this helps.

-2

To create a rendering in XM Cloud you will have to create a JSON Rendering , you can NOT create a controller rendering like SXA with XM Cloud.further you can follow this blog to see the end to end steps for creating JSON rendering in sitecore xm cloud

https://doc.sitecore.com/xmc/en/developers/xm-cloud/walkthrough--building-a-simple-custom-component.html

1
  • 1
    Please add the steps here as the link can expire in the future. Commented Jul 29 at 11:24

Your Answer

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

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