Working with Component Builder in Sitecore XM Cloud
In my previous blog, I have guided to setup Next.js app in Sitecore XM Cloud instance. In this blog, I wanted to explain how you can connect your cloned Nextjs App with your XM Cloud instance.
BUT I thought as we have not built
any component yet for site home page or any page and it will look odd to see a blank page after configuring and running on the local machine. So, I thought building a component using XM Cloud
Component Builder first and then will checkout configuring Nextjs app in next blog.
Creating Component using Component Builder
Step 1: Login into your Sitecore XM Cloud account
and click on your app.
On the right pane, click on Open app button.
Step 2: On the menu bar, click on Components
Step 3: Create Component Collection
This is the group of component under a single collection. This collection will be visible in Page builder and it become easy to search from categorised the components based on their nature or type.
Step 4: Choose a name to collection
Step 5: Add component in the collection, Click on Create new component.
Step 6: Give a name to component.
Step 7: Using canvas to create elements. This section is actually called component builder.
Step 8: Adding elements to the grid.
Step 9: Selecting card element and occupying the space
While building your component you can checkout the properties on left side pane. You can change the basic styles and other properties based on the element.
Step 10: Publish Component
So till now your component is ready to be applied on some page.
Step 11: Home page item is by default and under that i have create a new page item called about-me.
In this step we will be applying the our newly created component to main container.
Step 12: Applying Component from Collection
You can preview the page at anytime to see the changes.
Step 13: Using Out-of-the-box XM Cloud Components. For header, i wanted to use in built component.
I will use Link List and will create a
new Data Source
Step 14: Creating Data Source Item
Step 15: Editing list item
Adding link items and navigating to Content editor from page builder directly.
Step 16: Working on Content Editor
Basically we have created a data source item, which Link List
component will consume. We can re-use the same data source item for other pages
as well.
Step 17: Publish Changes
Step 18: Using Preview option to view the page
Step 19: Creating another page item
Below is the glimpse of Component collections and other
available components
Conclusion:
In the blog, I have create 2 components using XM Cloud Component builder and out-of-the-box component list with data source item. Both the components are applied on page using Page Builder. The idea was to ready our pages so that when we run the local nextjs app, then we can see them on local machine. In the next blog i will configure the next.js app with xm cloud.
Comments
Post a Comment