Expand my Community achievements bar.

SOLVED

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

Avatar

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

Avatar

Correct answer by
Level 7

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

Avatar

Level 7

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

Avatar

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)

Avatar

Correct answer by
Level 7

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