How to create a new template with a custom property in code? | Community
Skip to main content
Level 8
March 22, 2021

How to create a new template with a custom property in code?

  • March 22, 2021
  • 2 replies
  • 1020 views

There are pages of tutorials on creating templates via the web using crx/de ui or the template console and the "templates author" role.

 

However, we need to create page templates which are versioned and distributed as part of the code, and they need to contain custom properties.

 

Does anyone have a handy resource which describes how to new templates via code?

 

 

 

 

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

2 replies

Rohit_Utreja
Community Advisor
Community Advisor
March 22, 2021

Hi @tb3dock,

 

You can create your own set of templates in the project structure under /app/<project>/components/page.

 

You can commit this code in the code repository, in the ui.apps. Whenever you will deploy the code, these templates will be deployed in the AEM. Here you can maintain multiple versioned templates as per your requirement. 

TB3dockAuthor
Level 8
March 22, 2021
Thank you very much for the responses. I have seen that first link, but it only has how to create templates via the CRX/DE interface, not how to create template-types in code?