Templates
The Templates tab allows users to manage the templates created.
These templates can be used to create pages for the groups to be published on the web sites. They should be used if the pages have similar outlook and only certain content is different. All template should have a Template Content component added to act as a placeholder for a page’s content.
Only owner of the template can edit, download and delete the template files. Other users can only open the template file to view the content and preview the template.
By default the latest version is shown. To see all versions, select the “Show All Versions” field at the top of the tab.
Module Interface
Interface | Description | Required Privilege |
---|---|---|
CMS | Allows access to CMS management page. | mod-cms-management |
CMS Designer | Allows access to CMS Designer page. | mod-cms-designer |
CMS Designer | Allow to edit CMS Groups, Page, Template and Resources. | mod-cms-designer-edit |
Add Template
This function allows you to add a new template.
To do so, click on the “Add” button at the upper right corner of the page.
The “New Template” dialog box will appear.
Field | Description | Input Type | Default Value |
---|---|---|---|
Name | Unique name of template. | Text field | Empty |
Copy From | Indicates what template the new template would be based on. Selecting “Blank Template” results in using a blank canvass as a starting point. Selecting an existing template would result in having the selected template as the starting point. |
Drop-down list | “Blank Template” |
Key in a unique name for the new template. If the name already exist, it will add a new version to the existing template. The default version is 1
. If the name is left empty, the relevant error message will appear.
Select either copy from a blank template or an existing template. Note that in copying another template, any change made to the template in the “Copy From” would not be applied to the new template after its creation. Copying does not link any of the templates.
Click on the “OK” button to create the new template. The Template Designer will appear.
See Template Designer for more details on the designer.
Upload Template
This function allows you to upload a template file (JSON) onto the Templates tab.
Click on the “Upload” button at the upper right corner of the page.
The “Upload” panel will appear.
Browse to the location of the desired template file. The filename of the selected file will appear in the “Name” field. If the name is not desired, change to an appropriate name. If the name already exist, it will upload to that template as a new version.
Click on the “OK” button to upload the template file. To abort, click on the “Cancel” button. Upon successfully uploading, a message will appear.
Edit Template
This function allows you to edit the name and description of the template of a particular version.
To view all versions of the template, select the “Show All Versions” field at the top of the page. Click on the “Edit” icon under the “Actions” column corresponding the desired template version.
The “Edit” dialog box will appear.
In the dialog box, edit the “Name” and “Description” fields as required and click on the “Save” button to save the changes.
If the template version is the latest version, once saved, the version number will increment by one. If the template version is not the latest version, a dialog box will appear prompting you to confirm creating a new version of the template for the edits done.
To confirm, click on the “OK” button. To abort, click on the “Cancel” button. Once confirmed, the template with the current edits will be saved to a new version. Any previously saved versions (even deleted ones) will be counted towards the version number.
For example, if the current version is 3
and version 4
and 5
are deleted. The newest version with edits will be saved as version 6
.
Open Template
This function allows you to open the Template Designer.
To do so, click on the name of the page under the “Name” column.
The Template Designer will open with the template version selected.
See Template Designer for more details on the designer.
Preview Template
This function allows you to preview the template.
To do so, click on the “Preview” icon under the “Actions” column corresponding the desired template.
The template will be displayed in another windows tab.
Delete Template
This function allows you to delete a template of the selected version.
To delete a template, click on the “Delete” icon under the “Actions” column corresponding the desired template.
There is an option to undo the deletion. A notification with an “Undo” button appears right after clicking on the “Delete” icon.
Upon clicking on the “Undo” button, the deleted template is restored and is added back to the list of templates. Do note that only the selected version of the template is deleted.
More Actions
This feature allows user to perform actions on multiple templates at the same time.
When the “More Actions” button located at the upper right corner of the page is clicked, a list of available actions are displayed.
If no template is selected prior clicking the button, there will be fewer actions available. To select a template, select the checkbox next to the name of the template.
Option | Description |
---|---|
Select All | Selects all templates in the list. |
Select None | Unselects all templates. |
Invert Selection | Inverts the current selection. That is, any templates selected will be unselected and vice versa. |
Download | Downloads the templates selected. |
Download Template
This function allows you to download the selected template.
To download the selected templates, click on the “More Actions” button and select the “Download” option.
If one template is selected, the downloaded file will have the following file format:
<filename>.cms-template.json
If more than one template are selected, the “Download” dialog box will appear.
Key in a name in the “File name” field and click on the “OK” button. The downloaded file will be a zip file with the file name provided prior. The individual files in the zip file are JSON files.
Refresh
After performing actions on the browser/tab, the list is reloaded to display the list of templates. The manual “Refresh” button is available and is particularly useful if you have opened multiple pages and are making changes.
The “Refresh” button is found on the upper right corner of the page. Clicking on it reloads the list of templates.
Search
There is a cross-field search function for the list of templates. It is located at the upper left corner of the page.
This provides an easy way to search through the list of templates. It is case-insensitive and display templates that have the entered search value in any of the values of the fields below:
- Name
- Version
- Owner
- Last Modified
Alternatively, you can click on the any owner under the “Owner” column to aid the search for the templates in the page.
In the example above, template that belongs to the owner “cms-group-edit” is shown.
These two search methods can be combined together, with each criteria separated by a comma.