Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

sachinn20956098
Level 2
Level 2

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 :

1443485_pastedImage_0.png

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

1 Accepted Solution
BrijeshYadav
Correct answer by
Level 5
Level 5

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".

View solution in original post

3 Replies
BrijeshYadav
Level 5
Level 5

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

sachinn20956098
Level 2
Level 2

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
Correct answer by
Level 5
Level 5

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".

View solution in original post