How to fetch design dialog property value of a component in another component | Community
Skip to main content
sachinn20956098
New Participant
March 16, 2018
Solved

How to fetch design dialog property value of a component in another component

  • March 16, 2018
  • 3 replies
  • 5415 views

For example , I have a floating-brochure component with a design dialog and i want to use properties stored under this component(for example image path ) in another component say Footer (Both in same style).

Hierarchy of /etc/design/default is as below :

currentStyle.image works only in the floating-brochure component not in Footer component. How to access this value in Footer component ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrijeshYadav

In this case you need to use getStyle(Resource res ) method Design ("The Adobe AEM Quickstart and Web Application.")  and resource would be  "/etc/design/default/jcr:content/page/floating-brochure".

3 replies

BrijeshYadav
BrijeshYadavAccepted solution
New Participant
March 16, 2018

In this case you need to use getStyle(Resource res ) method Design ("The Adobe AEM Quickstart and Web Application.")  and resource would be  "/etc/design/default/jcr:content/page/floating-brochure".

sachinn20956098
New Participant
March 16, 2018

Yes both the components are on same page and hence same template.

But , on floating-brochure component , currentStyle.image is giving the path of the image stored. But if we try to use currentStyle.image in footer component it is giving null.

This is primarily because , on floating-brochure component value of currentStyle is /etc/design/default/jcr:content/page/floating-brochure , but on footer component value of currentStyle is /etc/design/default/jcr:content/page/footer (but footer node is not created here)

BrijeshYadav
New Participant
March 16, 2018

Are you using footer component on same template ? Here floating-brochure component is associated with page template.

Design dialog stored content at template level and value remain same though out all the pages which are created using same template.

/Brijesh