Expand my Community achievements bar.

SOLVED

Change rootPath of the pathbrowser depending on the context where the component is added

Avatar

Community Advisor

Have requirement: when component with pathfield in the dialog is dropped on site A, the pathfield rootPath should become /path/to/site/A

When the same component is dropped on site B, the pathfield rootPath should become /path/to/site/B

How would one achieve this in AEM with minimalistic amount of changes?

Regards,

Peter

1 Accepted Solution

Avatar

Correct answer by
Level 3

I totally understand your hesitation with it, and if it was more than just overlaying the dialog I would agree it's probably not a good approach, but the view/business logic stays the same between components.  You're either going to have to maintain JavaScript to customize, or use OOTB functionality to overlay only the dialog. 

View solution in original post

7 Replies

Avatar

Community Advisor

Hi,

Is it Touch UI dialog or classic UI?

Avatar

Community Advisor

Good question, sorry should have mentioned it before,

Touch UI AEM 6.3

Avatar

Level 3

I don't believe there is a clean code solution to this simply because of what the UI outputs for the data attributes.

What may be a better idea to consider is overlay your current component with a new one and only change the dialog.  This way you can give the component a different group and a different root path very cleanly.  On site A you allow component 1, on site B you allow component 2.  Simple and clean.

Avatar

Community Advisor

Thank you for your reply,

Problem is that we promote re-use of the same component across quite a lot of sites. Now, having to overlay components does not feel like a clean/right solution to this problem.

Regards,

Peter

Avatar

Correct answer by
Level 3

I totally understand your hesitation with it, and if it was more than just overlaying the dialog I would agree it's probably not a good approach, but the view/business logic stays the same between components.  You're either going to have to maintain JavaScript to customize, or use OOTB functionality to overlay only the dialog.