Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Page description & component description field to share the authored content

Avatar

Level 3

Hi,

 

I have the requirement where the page jcr description should be populated in a component's description field when dialog is open. please note: the component is authored on the same page. Now,  if I edit the description field in component dialog and save it. the new content or description should start reflecting in the page description field as well in page properties.

 

Is there any optimized way through which two fields with same name in different location(different locations meaning page component and individual component) can share the same data.

 

Please advise.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@ravijais04 

 

Option-1: Like @arunpatidar Instead of sharing a place to persist data. You can use following:

 

aanchalsikka_0-1697629185741.png

This is a snapshot from Teaser component. You can use the description from Page, and when needed override on component itself.

 

Option-2: Embed the component on template, so that the structure stays the same.

Now the description from Page properties should have a proper name like "./tile/openInNewWindow", here tile is the component and "openInNewWindow" is a property,

The property name is components' dialog should be "openInNewWindow"

I haven't tried it my-self. Just a thought

 

 


Aanchal Sikka

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

@ravijais04 

 

Option-1: Like @arunpatidar Instead of sharing a place to persist data. You can use following:

 

aanchalsikka_0-1697629185741.png

This is a snapshot from Teaser component. You can use the description from Page, and when needed override on component itself.

 

Option-2: Embed the component on template, so that the structure stays the same.

Now the description from Page properties should have a proper name like "./tile/openInNewWindow", here tile is the component and "openInNewWindow" is a property,

The property name is components' dialog should be "openInNewWindow"

I haven't tried it my-self. Just a thought

 

 


Aanchal Sikka

Avatar

Community Advisor

@ravijais04 

 

Just tried Option-2:

 

1. Created a new field in Page properties

aanchalsikka_0-1697699598509.png

2. Added a title field to the template at similar location. Unlocked component

aanchalsikka_1-1697699644355.png

 

3. Now when I edit via page properties, the property is reflected on page and vice versa

aanchalsikka_2-1697699698552.pngaanchalsikka_3-1697699712058.png

 

 


Aanchal Sikka