1

I am new to Sitecore products and my company has just purchased XM Cloud. I have gone through tutorials and classes about how to create and edit a site but I still do not understand how I can get data from an external source, like an API that I write, and have that data injected into the website pages.

In my instance, we have a catalog of thousands of products to display. How do I create a component that will display product names and prices so that I can list them on a catalog page, limiting the subset of products based on user search terms or menu selection?

I have looked a little bit into item buckets, but that seems to be a system for setting up the entire inventory in Sitecore, which I do not want to do because our inventory of parts is constantly changing and prices are customized to each customer anyway. Can someone explain the best practices for this, ideally with ASP.NET, or point me to some resources that specifically deal with XM Cloud and how to achieve this? Thank you.

2
  • 1
    Welcome to the Sitecore community, Pete! When building headless, you do need to architect for things as sets of services that your head is going to consume. If you have a separate system (external source) with your product data, then your head (website maybe?) is going to usually directly consume that. XM Cloud will have your content that your authors build out, which your head will pull through the Edge API layers. Unless your authors need to see the product info in the editing window and change it, you shouldn't have to integrate it into XM Cloud. Commented Oct 30, 2023 at 10:36
  • Thank you for the welcome. I have seen the Edge object in the structural layouts for how Sitecore works but have not really understood it, I will look at it further.
    – Pete
    Commented Oct 31, 2023 at 13:44

2 Answers 2

3

you can start with the Sitecore documentation about XM Cloud development at https://doc.sitecore.com/xmc/en/developers/xm-cloud/index-en.html

There is a section for Sitecore ASP.NET Rendering SDK API, that may help you with a .Net reference.

I recommend you clone the Git Repo for the XM Cloud Foundation at https://github.com/sitecorelabs/xmcloud-foundation-head/, it is the base NextJS application for start developing in XM Cloud.

Related to how to call an external API, when you create a NextJs component you can use the fetch() function to get data from external APIs easily.

Hope it helps, and if you need further support, don't hesitate and find me in Slack.

2
  • Thank you for these links, it is helpful to know where to start.
    – Pete
    Commented Oct 31, 2023 at 13:42
  • Always glad to help :) Commented Oct 31, 2023 at 16:53
3

With xmCloud and Experience edge you need to use graphql to retrieve the published results from the Experience Edge.

If you have a large inventory, you may want also to consider using Sitecore search. We have recently integrated the Sitecore Search for our project, it can be integrated with any product, xmCloud, SAP, .... . For example, Sitecore search is reading the Job Offers from the SAP and the nextJs will show the results that are comming from the sitecore search.

It would be quite useful if you have your products in an external system, you can just let the sitecore search index the products, then in frontend use the search api and powerfull faceting any many other features like scheduled crawling to update the index,Analytics, suggesstions, and ... .

Even if you must import the products to the xmCloud the Sitcore search can be quite useful because of the features that it can provide.

If you are creating the e-commerce system or content management system to only show products, i suggesst to talk to your sitecore partner or sitecore representative to choose the best products that sitecore offers for your needs:

  • Sitecore Connect: Integration with other System
  • Sitecore Search: Very powerful search with easy integration with other systems
  • Sitecore Send: For Email
  • Sitecore Xmcloud: Content management
  • Sitecore Ordercloud: Sitecore Commerce solution
  • Sitecore CDP: For Analyitcs/ Personalization
1
  • Thank you for the advice, this is appreciated.
    – Pete
    Commented Oct 31, 2023 at 13:42

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.