Skip to content

Instantly share code, notes, and snippets.

@VivekSaha
Created September 29, 2025 18:49
Show Gist options
  • Select an option

  • Save VivekSaha/2da4d4b896135d8ba4fc7e668d17a394 to your computer and use it in GitHub Desktop.

Select an option

Save VivekSaha/2da4d4b896135d8ba4fc7e668d17a394 to your computer and use it in GitHub Desktop.
AEM - Custom component without dialog Code level
Custom component without dialog:- Code level
Step 1 - Create component folder "productdetails"
e.g:- ui.apps\src\main\content\jcr_root\apps\aemgeeks\components\productdetails
Step 2 - Create a ".content.xml" file
e.g:- ui.apps\src\main\content\jcr_root\apps\aemgeeks\components\productdetails\.content.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Product Details"
componentGroup="CustomComponents"/>
Step 3 - Create a .html file with the same name of component "productdetails.html"
e.g:- ui.apps\src\main\content\jcr_root\apps\aemgeeks\components\productdetails\productdetails.html
<div class="product-details">
<h2>Product Title</h2>
<p>Product short description.</p>
</div>
Step 4 - If there is no any dialog then create a "_cq_editConfig.xml"
ui.apps\src\main\content\jcr_root\apps\aemgeeks\components\productdetails\_cq_editConfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:EditConfig"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment