Search code examples
gitaemmaven-archetype

What is the proper way to create Editable Templates in AEM?


I have created an AEM project with maven archetype and there are some ready-to-use components/templates come with the project.

Since Editable Templates are recommended to be created by Template Authors in AEM itself I am wondering how should I keep my project synchronized. I don't know whether I should push these templates to shared repository.

If an Author creates a new Editable Template in AEM there would be some synchronization problem between git repository and AEM instance. It would also be some different templates in different environments of AEM instances. (E.g Test and Prod env.)

What is the best way to create Editable Templates? How to keep them synchronized between different environments? (Git Repo and AEM Instance/s)


Solution

  • There was a good talk on last years adaptTo-conference in Berlin.

    https://adapt.to/2019/en/schedule/aem-template-editor-in-practice.html

    The topic you are interested are challenges #6 and #7 (in the video 23m:12s - 30m:30s). In summary it says, there is no good solution. The "simple solution" is to only allow developers to change something. Or you need a back-channel from your PROD system (to get it down to all other environments - just like you should do with normal content)

    For single-brand AEM projects, I would recommend the "simple solution". A "template editor" is changing the template on DEV or QA. A developer is reviewing the changes, and sync's the changes into the GIT repo (before DEV or QA is deployed). Then it is tested/deployed like any other code change.

    For multi-brand AEM projects with a many, many templates and a lot of generic components with a lot of design settings, then I would recommend the back-channel approach. Think of something like Unilever with hundreds of different brands. In such scenarios you have almost daily changes on some templates - and probably skilled template editors.


    The pro's and con's of the "simple solution" are:

    • Negative/neutral: time to market is 2-3 days (was OK for all of my projects)
    • the templates and content policies are kept clean (review of an developer)
    • it enforces a more careful planning, which results in less templates
    • the GIT repo is the single source of truth for all environments
    • normal deployment processes
    • template changes can be tested
    • Most negative: The template editor needs a developer (works only for actively supported/maintained projects).
    • Negative: Little benefits from Template GUI. Often the "template editor" just asked the developers for a change. Then static templates may be good enough.

    PS: All the template editors I know, ...

    • prefered the DEV environment - as it was easier to reset (so the felt more free to experiment).
    • didn't want to change anything on PROD directly, because they were afraid to destroy something

    Hopefully this gives you some hints, what is best for you.

    Alex