Best approach to restrict Experience Fragment components per template in AEM
We have a requirement involving seven different templates in AEM. For each template, we want to allow the Experience Fragment component, but with a restriction: the Experience Fragment should only allow the components that are specifically permitted for that template.
In other words, each template has its own set of allowed components, and the Experience Fragment should enforce those rules so that authors cannot add components outside the template’s defined scope.
We would like to understand:
-
What is the best possible solution to achieve this scenario?
-
Are there recommended practices or configurations in AEM to enforce template-specific component restrictions within Experience Fragments?
Any guidance or examples from the community on how to implement this in a scalable and maintainable way would be greatly appreciated.