Custom Component in Sitecore SXA

Steps for creating custom component :


A. Create a new module:

1. Navigate to /sitecore/system/Settings, right-click Features or Foundation, and insert a new folder.
2. Right-click Features or Foundation, click Insert, and click Module.
3. Enter a name and group the module under the new folder.
4. Check only Site Setup.
5. Click Proceed.

Note :
Do not place your custom modules in the Experience Accelerator folder. This folder is overwritten during updates.


B. Clone Rendering

1. To clone the rendering that you want to use, navigate to /sitecore/Layout/Renderings/ Feature/Experience Accelerator/Page Content/Promo 
2. Right-click the rendering that you want to clone. 
3. Click Scripts and click Clone Rendering. 
4. In the Create derivative rendering dialog box, fill in the following fields:






C. Update Old Template Fields

1. Navigate to /sitecore/templates/ Features or Foundation/your folder/Custom Promo.
2. Add or update the required fields. 

Note : Remember to update Title of field also.


D. Update Old Variants

1. Navigate to /sitecore/templates/Branches/ Feature or Foundation /your folders/Default Custom Promo Variant, open $name -> Default
2. Add or update required variants.



E. Add Module to Site\Tenant

1. Navigate to /sitecore/content/Tenant/Site, right-click on site, click Insert, and click Add Site Module.
2. Modules List will appear which can be added to site\tenant.
4. Check required modules.

5. Click OK.




FCreate Data Folder


1. Please check if there is folder named Custom Promo in /sitecore/content/Tenant/Site/Data. If yes, proceed to point 3.
Navigate to /sitecore/content/Tenant/Site/Data, right-click on data, click Insert from template, navigate to templates/feature or foundation/your folders/Custom Promo Folder and provide name as Custom Promo.
3. Right Click on above folder and click insert from custom promo and create data.
4. Enter data in fields.

G. Add Rendering in Available Renderings

1. Navigate to the Presentation folder of your site and right-click Available Renderings.
2. Check if there is entry in it by name of your site and your rendering selected in it. If no then procced next.
3. Click Insert and click Available Renderings.
Enter the section name for the rendering that you want to add and 4. click OK.
5. Click the new section that you just created, and in the Data section, click Edit.
6. In the Select Item dialog box, in the Renderings folder, click the relevant rendering, and click the right arrow to move it to the list of selected items. Click OK.


G. Create A Page And test rendering.

Comments

Popular posts from this blog

Custom Dropdown in Sitecore form

Search Page in Sitecore SXA

How to use snippets in SXA project