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

AEM Editable Templates - Fixed position for components in the Templates

Avatar

Level 2

We have a requirement to fix 3 components (For Example, Component A, Component B & Component C) on the top of the specific editable template. For this template, we have also allowed other components (For Example, Component D, Component E & Component F) to be added by the authors below the fixed components. 

 

We have achieved it by adding those components (Component A, Component B & Component C) in the structure & initial nodes of the template.

 

But we are unable to solve the following scenarios.

 

1) We are not able to restrict addition of other components (Component D, Component E & Component F) on top of the fixed components (Component A, Component B & Component C). For example, Component D can be added on top of the Component A in the page by the page authors.

 

2) We are not able to restrict moving of other components (Component D, Component E & Component F) on top of or in between the fixed components (Component A, Component B & Component C). For example, if page author adds Component D in the page & then move it between Component A & Component B in the page.

 

In simple words, the components A, B & C should be strictly fixed on top of the page.

 

Please suggest the possible solutions for this use-case.

 

@kautuk_sahni @arunpatidar @aanchal-sikka @EstebanBustamante 

@Raja_Reddy @TarunKumar @Saravanan_Dharmaraj @Jörg_Hoh 

@lukasz-m 

 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @S__k__Agarwal 
I don't think so you can have same component in Structure as well as Initial, because during rendering content of both merged.

and if content is added to a component in structure mode and that component is later unlocked (or conversely), then this content is used as initial content.

In your case you need to fixed the container in Structure which allows Component A, Component B & Component C.

Then another container/parsys  in Structure which allows Other components.

 

You may need to proxy the the top Container component to allow the different policy

 



Arun Patidar

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @S__k__Agarwal 
I don't think so you can have same component in Structure as well as Initial, because during rendering content of both merged.

and if content is added to a component in structure mode and that component is later unlocked (or conversely), then this content is used as initial content.

In your case you need to fixed the container in Structure which allows Component A, Component B & Component C.

Then another container/parsys  in Structure which allows Other components.

 

You may need to proxy the the top Container component to allow the different policy

 



Arun Patidar

Avatar

Community Advisor

If it is fine for the project then you can also possibly use a combination of editconfig and listeners.
For e.g removing insert from cq:actions in editconfig for these components should disable addition of components above them. And if more checks are needed then a beforeedit listener can also be created for further validations.