{"id":7496,"date":"2020-01-28T18:31:18","date_gmt":"2020-01-28T13:01:18","guid":{"rendered":"https:\/\/www.argildx.us\/?p=7496"},"modified":"2021-02-24T13:31:18","modified_gmt":"2021-02-24T08:01:18","slug":"how-to-create-and-enable-dynamic-templates-in-aem","status":"publish","type":"post","link":"https:\/\/www.argildx.us\/technology\/how-to-create-and-enable-dynamic-templates-in-aem\/","title":{"rendered":"How to Create and Enable Dynamic Templates in AEM"},"content":{"rendered":"\n

A new feature called Dynamic Templates was introduced in AEM 6.2. This feature is also known as Editable Templates in AEM for the obvious reason that these templates can be created and edited at any time.  <\/p>\n\n\n\n

Generally, the control of creating and structuring templates is given to more specialized author groups called \u201cTemplate Authors\u201d. 

The diagram below depicts the requirements to create a content page.<\/p>\n\n\n\n

\"the<\/figure><\/div>\n\n\n\n

In order to fulfil these requirements, the collaboration of roles below is important:

1. Developer <\/strong>concentrates on development of page components and template types and provides necessary information to template author. 
2. Template Author <\/strong>is responsible for creating templates using template types, configuring use of components on templates.
3. Content Author <\/strong>is responsible for creating and editing content pages using templates.<\/p>\n\n\n\n

Dynamic templates provide tremendous capabilities and flexibility in configuring templates<\/strong>:  <\/h5>\n\n\n\n
  1. Rather than developers, template authors can create and edit templates.
    <\/li>
  2. Provides template authors with touch optimized UI \u201cTemplate Console\u201d for managing the lifecycle of templates and \u201cTemplate Editor\u201d to configure templates.
    <\/li>
  3. For any page a content author creates using a dynamic template, template authors need to configure three parts of the template:
    Structure:<\/strong> Define components and content for template
    Initial Content:<\/strong> Define content visible on page when it is first created
    Policies:<\/strong> Define design properties of a component
    <\/li>
  4. Dynamic connection is maintained between the page and template, modification in structure will reflect on all pages created using the template, whereas modification in initial content is reflected only on the new pages created using the template.
    <\/li>
  5. All the dynamic templates are stored under \/conf<\/strong>
    <\/li>
  6. Design mode is not offered on pages created using dynamic templates. This can be achieved by creating component policies in template editor.
    <\/li>
  7. Provides concept of Page Policy to define specific client-side libraries to be loaded on each template.<\/li><\/ol>\n\n\n\n

    Let\u2019s jump into implementation and see how to create dynamic templates in AEM.   <\/p>\n\n\n\n

    Step 1: Activate Editable Templates in your project  <\/strong><\/h5>\n\n\n\n

    With editable templates, templates are stored under \/conf. In order to create project specific template hierarchy under conf, we can use configuration browser.<\/p>\n\n\n\n

    1. Navigate to Tools > Configuration Browser<\/li>
    2. Click on Create  <\/li><\/ol>\n\n\n\n
      \"a<\/figure><\/div>\n\n\n\n

      3. On Create Configuration dialog, configure:<\/p>\n\n\n\n