March 18, 2020
Estimated Post Reading Time ~

CQ Dialog VS Design_Dialog in AEM/ Adobe CQ5

Dialog and Design_Dialog are different. Depending on the application need, the choice between them is made.   

A frequent question about the topic is, “How to decide between dialog and design_dialog to be used?”
To understand this question, we need to understand the basic difference between Dialog and Design_Dialog.

Basic Difference
As we know, pages are generated from templates and we can drag and drop components on the page. The components are the building blocks of your web pages. To have control over the configurations/content of the component/webpages in real-time, the webpage author is provided with the dialog/design_dialog.
One major part of configurations/content is it can be,
1. Page-specific
2. Global (Accessible through-out the website, saved in design)
So, here’s the answer to “How to decide between dialog and design_dialog to be used?” that when we want the configurations/content to be page specific then we use dialog and when we want the configurations/content to be page specific then we use design_dialog.   

Other Differences:
There are other differences between dialog and design_dialog, which are about the
1. Accessibility
2. Definition
3. Value storage
4. Value accessibility
“Dialog’s” below represents “dialog and design_dialog”
· Accessibility of Dialog’s: The dialog is accessible to the author in the edit mode of the page. Whereas the design_dialog is accessible in design mode on the page. Design mode can be accessed directly from sidekick by clicking the “design” icon at the bottom of the sidekick.   

· Definition of Dialog’s:
Creating dialog: Right-click on component >> Create node dialog is created.

Creating design_dialog : Right-click on component >> Create nodedesign_dialog is created. 


· Value storage of dialog’s: When we create fields in the dialog, each field must have a property whose value is “./<whatever>”, The values in the dialog are stored as these properties. 

Dialog: The values in the dialog are stored in /content directory under page jcr:content node.
Below image shows the content from dialog of “Header” component on geometrixx/en page
Hence the content from dialog for a component on page get stored in /content/<page>/jcr:content/<component node>

Design_dialog: Design dialog values are always stored in /etc/design directory under the design page. There is an option to declare cq:designpath property for the template. cq:designpath always points to design page under /etc/design directory ex: etc/design/myproject. 

If cq:designpath is declared then all design_dialog values will be saved below etc/design/myproject /jcr:content/<Pagecontext>/<component> 

Else, all design_dialog values will be saved below /etc/design/default/jcr:content/<Pagecontext>/<component>
 
Here, Pagecontext is the name of the component, template refers to. 

· Value accessibility:
Dialog: dialog values are accessed in jsp using properties object as, properties.get(“”,””);
Design_dialog: design_dialog values are accessed in jsp using current style object as, currentStyle.get(“”,””);



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.