Understand how AEM links Template Types, Templates, and Page Components to control page structure, policies, and authoring behavior. Learn how each layer connects, where they live in the repository, and how they work together to define consistent, reusable page foundations.
Every site usually needs different kinds of pages: a marketing landing page, a news article, and a generic content page. Each one should have its own layout, allowed components, and page properties.
AEM starts with template types that allow developers to define those base setups (page component, structure, policies). Using those, authors create instances called templates that show up in the Create Page Wizard.
Most websites have a goal of consistency across their pages, and templates allow this by having repeatable page layouts with rules baked in (instead of authors free-styling every page). Relationships between the two can become confusing quickly.
That’s where I hope to assist you in clarifying the workflow!
There are a couple different directories for templates.
Adobe’s OOTB templates /libs - this is what you should extend or overlay:
/libs/settings/wcm/template-types
In most projects, you’ll create at least one custom template type. These live in project specific template type locations:
/apps/settings/wcm/template-types
/conf//settings/wcm/template-types
Here is a view of the Touch UI. Choose a type..
Then, you will see this screen. Name your Template.
If nothing shows up after clicking the Create button in the Templates console, it is either:
/conf/ /settings/wcm/template-types . Follow the next steps below to see how I create/define my template.
See the #Troubleshooting section on this page for more help on how to fix these!!
While I was writing this blog, I didn’t have any templates listed and saw the above error! This was because I hadn’t created any in the code yet. So I will walk through how to do that next.
In the code editor, I will go to the above directory and create a structure that looks like this:
You’ll notice that I have created a few template types here. Among these are page, page-v2, and an empty-experience-fragment. After running a fresh maven build and if the structure is correct, the template types will then pop up on the Create Template Touch UI screen. I will no longer see the Error message that I am unable to create a template!
Touch UI view:
Code View:
Structure: Locked components in a template that authors can’t move or delete (header, footer, fixed containers, etc.).
Initial Content: Default content that’s copied to new pages when they’re created. Authors can change or delete this on each page.
What’s the difference? Let’s go over each in detail and talk about how they interact with each other.
Inside the template type’s
jcr:content, thesling:resourceTypeproperty points to your page component (/apps/.../components/page). That’s how AEM knows which page component to use for any template created from that type.
/apps/settings/wcm/template-types
/conf/<your-site>/settings/wcm/template-types
http://localhost:4502/libs/wcm/core/content/sites/createtemplatewizard.html/conf/YOUR_SITE
content.xml file, it will not show up on the selection screen when you navigate to the Touch UI address.
Note: Template types don’t have to be exposed in the Touch UI. If authors should not be creating new templates from a certain type, lock them down with permissions or keep those template types in a folder only your template-author group can access.
/conf , possible directory:
/conf/<your-site>/settings/wcm/templates
http://localhost:4502/libs/wcm/core/content/sites/templates.html/conf/YOUR_SITE
/conf.
/apps (or ui.apps depending on the project structure).
/conf//settings/wcm/policies
Template types and templates defines which policy paths are used for each component, but the policy rules themselves are defined within this subtree. These rules control a myriad of things like allowed components, design options, etc.
Policies can also be edited/modified within the Touch UI!
Every page under /content has a jcr:content node that usually contains:
cq:template → path to the template
/conf//settings/wcm/templates/article-page
cq:templateType (optional) → path to the template type
/conf//settings/wcm/template-types/article-template-type
A page points to a Template, and the Template points back to a Template Type
AEM developer and frontend specialist with expertise in Adobe Experience Manager, React, and modern web development. Passionate about creating accessible, performant web experiences.
Comments
Comments are not yet implemented. This is a placeholder for future comment functionality.