Apache Sling > Sling CMS > Administration > Templates
Templates in Sling CMS are used to define the structure, allowed components, allowed locations and fields for pages created in Sling CMS sites.
Each template is created within a Site Configuration. To create a new template, open Configurations in the left navigation and navigate into the Site Configuration.
In the Site Configuration select +Template. This will open a modal window to configure the new template. Set the title of the template then click Create Template
Once the template is created, select the pencil icon to edit the template. There are a number of fields available on the templates:
jcr:primaryType
of the page node, the jcr:content/sling:template
attribute (which should be the path to this template) and the jcr:content/sling:resourceType
which is the resource type of the component to render the pageIn addition to these fields, there are two other configurations:
These fields are used to configure the pages created with the template when the page is created. Values from these fields can be referenced within the template content by name. At a minimum, you will generally have a name and title field.
To create a new configuration field, select the + button at the bottom of the container. This will open a dialog for you to select the type of configuration field to add:
Once you have selected the field, click the Add Component button and then select the pencil icon next to the new field to edit the field.
The different field types will have different configuration values, but generally you will have to specify a title and name for the field.
Component configurations are used to share configurations values with all of the pages using the template.
To add a new component configuration: