AEM Editable Templates - Fixed position for components in the Templates | Community
Skip to main content
Level 3
September 17, 2024
Solved

AEM Editable Templates - Fixed position for components in the Templates

  • September 17, 2024
  • 2 replies
  • 670 views

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 @joerghoh 

@lukasz-m 

 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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

 

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 17, 2024

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
h_kataria
Community Advisor
Community Advisor
September 24, 2024

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.