Build Your First Template
A Make template is made up of several components that together define how a configuration should be applied to your sites. This introduction walks you through creating a simple template that can create or update a site collection and provision a few SharePoint elements.
Components
A good template begins with a clear structure. Every Make template contains:
- A folder with an identifiable name that holds all template elements
- A configuration.xml file that defines the template
- Optional files used during provisioning, such as images or documents
Optional assets can be placed in the root or in subfolders, but using an Assets folder with meaningful subfolders is recommended—for example, Assets/Images for image files.
Configuration File
Start by creating a folder named MyFirstTemplate in the configurations library. Inside it, create a folder named Assets and a new XML file named configuration.xml.
After creating the file, update the SharePoint list item properties:
-
Name: Must be
configuration.xml. Changing the name prevents the template from appearing in the Apply configuration page. -
Title: A clear, descriptive name. This is what users see when selecting the template.
-
Configuration version: Use this to track your template’s version. A four-digit style (e.g., 1.0.0.0) works well.
-
Configuration description: Shown on the Apply configuration page after selecting the template.
-
Start object type: Defines the scope. Allowed values:
- Tenant - For new site collections, created with Make engine templates or the use of playlist.xml
- Web - For subsites, created with Make engine templates or the use of playlist.xml
- Site - For modifying existing site collections, created with PnP engine templates.
-
Configuration parameters: A JSON string containing template parameters. These can be used to ask users for input such as site title or URL. Parameters are covered in detail in the Make Technical Reference.
Configuration Template
At this point the template appears on the Apply configuration page, even though the XML is still empty. The example below assumes that three parameters have been defined: Url, Title, and Owner.
Begin by adding the root element and specifying the provider:
|
|
The Configurator tag is required as the root. The provider you choose determines how Make processes the template.
For creating site collections, use the SiteProvider, which works with the Site tag.
Add the basic site configuration:
|
|
Here’s what these attributes do:
- Url, Title, OwnerLogin map to your template parameters.
- Template=“STS#0” creates a standard Team site as the root web.
- LCID, StorageQuota, and UserCodeQuota define language and quota settings.
You can already run the template and create an empty site collection. Just make sure you’re included as an owner.
Adding a List
Let’s make things more interesting by adding a document library to the root web:
|
|
The RootWeb element behaves like a normal Web element, although SharePoint creates the root web automatically. The library named Private documents will be added during the update phase.
Adding Permissions and a File
Next, break role inheritance on the library and add a document:
|
|
Breaking inheritance ensures that only the site collection owner has access. Even if users are added to the site, they won’t be able to open this library unless permissions are granted manually.
The file Document1.docx will be added to every site collection created with this template.
To make this work, place the file in your template folder:
MyFirstTemplate/Assets/Document1.docx
Run the template and you should see the document in the library.
More detailed features and advanced scenarios are covered in the Make Technical Reference. Before implementing a new feature, check that section for notes and examples.