Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Page component and its fields.

Avatar

Level 7

For any page component how to get what are the fields corresponding to that page component. 

For example : 
For content fragment page component "text" is field, please refer the below page json.

Where this mapping of page component and corresponding fields are stored in crxde. 

akshaybhujbale_0-1681108012796.png

akshaybhujbale_1-1681108104352.png

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

So this is my understanding of your requirement.

 

You want to know what fields are available for any given component. If so, the only place you can find that information is in your dialog.xml. However, it's not a straightforward process. The dialog.xml is defined in a specific way, so you have to search for all nodes with a sling:resourceType defined and retrieve those details. I don't believe there's a simple way to do that. You'll have to write some code to obtain those details.


Why because , if it is not your local , you cannot access /apps using a URL directly. If it is your local you can try something like 

http://localhost:4502/apps/wknd/components/helloworld/cq:dialog.-1.json

 

However, if you're only interested in Content Fragment Fields, it's a different matter altogether. A Content Fragment is not a component, but rather an Asset that's available in your DAM (/content/dam).


For e.g if you have installed the WKND project , you can find the Content Fragment Model for author at http://localhost:4502/mnt/overlay/dam/cfm/models/editor/content/editor.html/conf/wknd-shared/setting... 

 

This model defines the fields for each content fragment for Author. 

Veena_Vikram_0-1681194244682.png

 


To see the field details you can try http://localhost:4502/conf/wknd-shared/settings/dam/cfm/models/author/jcr:content/model/cq:dialog.-1...

Veena_Vikram_1-1681194263732.png

 

Hope this helps. Let me know if you are looking for something different. 

 

Thanks

Veena ✌

View solution in original post

5 Replies

Avatar

Community Advisor

@akshaybhujbale Can you try adding .1.json to a page that will expose the details/ properties of that particular page component

For Example: localhost:4504/content/we-retail/language-masters/en/experience/arctic-surfing-in-lofoten.1.json

If you want complete data i.e., components that are authored on a page you could add .infinity.json

Hope this helps
Krishna

Avatar

Level 7

Hi @krishna_sai 
As per my usecase I need CRXDE path or configuration path on UI.

I need page component and fields mapping. 

Ex. contentFragment: text 

Avatar

Community Advisor

Can you elaborate your requirement on what exactly are you looking for here ? I am afraid , I am not clear about your ask here. 

 

Thanks

Veena ✌

Avatar

Level 7

Hi @VeenaVikraman 
How we will get know if the content fragment text will come under "text" field. 
Where this mapping is stored in CRXDE

akshaybhujbale_0-1681121259444.png

 

Avatar

Correct answer by
Community Advisor

So this is my understanding of your requirement.

 

You want to know what fields are available for any given component. If so, the only place you can find that information is in your dialog.xml. However, it's not a straightforward process. The dialog.xml is defined in a specific way, so you have to search for all nodes with a sling:resourceType defined and retrieve those details. I don't believe there's a simple way to do that. You'll have to write some code to obtain those details.


Why because , if it is not your local , you cannot access /apps using a URL directly. If it is your local you can try something like 

http://localhost:4502/apps/wknd/components/helloworld/cq:dialog.-1.json

 

However, if you're only interested in Content Fragment Fields, it's a different matter altogether. A Content Fragment is not a component, but rather an Asset that's available in your DAM (/content/dam).


For e.g if you have installed the WKND project , you can find the Content Fragment Model for author at http://localhost:4502/mnt/overlay/dam/cfm/models/editor/content/editor.html/conf/wknd-shared/setting... 

 

This model defines the fields for each content fragment for Author. 

Veena_Vikram_0-1681194244682.png

 


To see the field details you can try http://localhost:4502/conf/wknd-shared/settings/dam/cfm/models/author/jcr:content/model/cq:dialog.-1...

Veena_Vikram_1-1681194263732.png

 

Hope this helps. Let me know if you are looking for something different. 

 

Thanks

Veena ✌