Describes one page or content template that an app makes available for creating new resources, found via TemplatingApplication.appendTemplates and TemplatingApplication.findTemplateDef. Carries the template's path and display description, a factory for the prototype resource it creates, and flags for whether it can be used to create content pages or is a theme-only template.
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| contentTemplate | boolean | Whether this template can be used by users to create new content pages, as opposed to being theme-only. |
| description | String | The display description shown for this template when a user picks a template to create a new page from. |
| editor | String | The editor used to edit content created from this template. Null selects the default KEditor; other values, such as "texteditor" or "edmEditor", select an alternative editor. |
| fileName | String | The template's file name, within its parent folder. |
| pageType | String | The page type this template is associated with, used to match components that should be available for pages created from it. |
| parentPath | String | The path of the folder this template lives in. |
| path | String | The template's full path, combining its parent folder path and file name. |
| prototype | CommonResource | Creates a new, empty instance of the resource type this template produces, using this template's prototype supplier. Returns null if no prototype supplier was given. |
| themeTemplate | boolean | Whether this is a theme-only template, ie a template for templates rather than for content pages. |
Methods
getParentPath() · getFileName() · getDescription() · getPath() · getPrototype() · isContentTemplate() · isThemeTemplate() · getEditor() · getPageType() · withEditor(String editor)
getParentPath()
Returns: String
The path of the folder this template lives in.
getFileName()
Returns: String
The template's file name, within its parent folder.
getDescription()
Returns: String
The display description shown for this template when a user picks a template to create a new page from.
getPath()
Returns: String
The template's full path, combining its parent folder path and file name.
getPrototype()
Returns: CommonResource
Creates a new, empty instance of the resource type this template produces, using this template's prototype supplier. Returns null if no prototype supplier was given.
isContentTemplate()
Returns: boolean
Whether this template can be used by users to create new content pages, as opposed to being theme-only.
isThemeTemplate()
Returns: boolean
Whether this is a theme-only template, ie a template for templates rather than for content pages.
getEditor()
Returns: String
The editor used to edit content created from this template. Null selects the default KEditor; other values, such as "texteditor" or "edmEditor", select an alternative editor.
getPageType()
Returns: String
The page type this template is associated with, used to match components that should be available for pages created from it.
withEditor(String editor)
Returns: TemplateDef
Returns a copy of this template definition with the given editor set. Used to fluently override the editor on a template built from one of the other constructors.
| Parameter | Description |
|---|---|
editor | the editor name to set on the new template definition |