April 7, 2020
Estimated Post Reading Time ~

Why to use ./ while giving a name for cq:widget

Question: Why do we use ./ while giving a name for cq:widget. I didnt find any answer about it anywhere clearly. Is it a stardard way to do it or there is some meaning to it ?

Answer: In AEM every piece of content is treated as resource. if you have name = ./textValue, you might notice name is given as a relative path.

This is where REST comes into the picture, now when you can easily access this value via path /content/project/en/demo/jcr:content/right-side-content/text-component/textValue.json [ its project specific, your might be different.]

As /content/project/en/demo/jcr:content/right-side-content/text-component is your component path in crxde

“./” denotes next relative path which is ./textValue.

Which adds up to give you a resource path to /content/project/en/demo/jcr:content/right-side-content/text-component/textValue.json

This is what I feel from AEM, sling, REST point of view.


By aem4beginner

No comments:

Post a Comment

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