Templates in AEM

In Adobe Experience Manager (AEM), templates are fundamental blueprints that define the structure, initial content, and design properties for pages or other content entities created within the platform.1 They serve as a starting point, ensuring consistency, streamlining content creation, and empowering authors to build pages efficiently.2
When an author creates a new page in AEM, they first select a template.3 This template then provides the base framework for the new page, including:
Structure: The fixed layout and arrangement of components that cannot be changed by authors on the resulting page. This often includes elements like headers, footers, and predefined content areas.4
Initial Content: Pre-filled content within components that authors can then modify or replace.5 This helps provide a head start for content creation.
Content Policies: Rules that dictate which components are allowed in specific areas of the page and how they can be configured (e.g., specific styles or options for a text component).6
Layout: Responsive grid configurations to ensure the page renders correctly across different devices.
Types of Templates in AEM:
Historically, AEM offered two main types of templates for pages: Static Templates and Editable Templates. While both serve the purpose of creating pages, they differ significantly in their creation, management, and flexibility.7
1. Static Templates (Deprecated/Legacy)
Definition: These were the traditional templating system in AEM, available in older versions.8 They are defined and configured primarily by developers.
Creation: Developers define static templates as a hierarchy of nodes in the JCR (Java Content Repository) under
/apps
. 9They often involved JSP or HTL files and required developer intervention for any structural changes.10Connection to Pages: When a page is created from a static template, the template's structure and initial content are copied to the new page. There is no dynamic connection maintained afterward. This means if the static template is changed, existing pages created from it will not automatically reflect those changes.
Design Properties: Design properties (e.g., allowed components in a paragraph system) were configured using "Design Mode" on a page and stored under
/etc/designs
.Flexibility: Less flexible for authors. Any structural or design changes required developer involvement.11
Storage: Stored under /apps.
Status: As of AEM 6.5 and AEM as a Cloud Service, Static Templates are not considered best practice and are largely deprecated in favor of Editable Templates.12
2. Editable Templates (Modern/Recommended)
Definition: Introduced to provide more flexibility and empower non-developer users (template authors) to create and manage page templates.13
Creation: Editable Templates are created and managed through the AEM Template Console and Template Editor (Tools > General > Templates).14 This user-friendly interface allows template authors to:
Define the structure of the page (locked components that cannot be moved/deleted by page authors).15
Add initial content (unlocked components that page authors can edit).
Define content policies for components, controlling allowed components and their configurations within specific areas.
Configure responsive layout grids.16
Connection to Pages: A dynamic connection is maintained between the Editable Template and the pages created from it.17
Structural changes made to the template are reflected on all existing pages based on that template.
Initial content changes in the template are not reflected on existing pages, only on newly created pages.
Design Properties: Design properties are managed via content policies directly within the Template Editor. "Design Mode" is no longer used for editable templates.
Flexibility: Highly flexible for authors.18 Template authors can modify the template's structure, initial content, and policies without needing a developer.19 This significantly reduces development overhead for common site structure changes.20
Storage: Stored under
/conf
. This separation from/apps
(where code lives) aligns with content and configuration best practices.
Other Types of Templates (Beyond Page Templates):
While "Page Templates" are the most common association with "templates" in AEM, it's worth noting other template concepts:
Content Fragment Templates: These define the structure and initial elements for Content Fragments, which are content entities used for headless delivery and omnichannel experiences.21 They define fields, data types, and variations for structured content.
Experience Fragment Templates: These define the structure and initial content for Experience Fragments, which are reusable content and layout modules that can be embedded across pages, channels, or even used for A/B testing.22
In summary:
AEM templates are crucial for standardizing web page creation.23 Editable Templates are the current standard and recommended approach, offering powerful capabilities for template authors to manage page structures and content policies dynamically, leading to more efficient content management and reduced dependency on developers for day-to-day site structure adjustments.
Subscribe to my newsletter
Read articles from sagar karotia directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

sagar karotia
sagar karotia
I am a passionate frontend developer