The page template config is defined in JSON, in each page template HTML page. There are two ways to set the page template config:
<!-- Option 1: <cms-page-config> tag -->
<cms-page-config>
{
"title": "Standard Template"
}
</cms-page-config>
<!-- Option 2: Script tag -->
<script type="text/cms-page-config">
{
"title": "Standard Template"
}
</script>
The page template config can contain any of the following properties:
{
"title": "Template Name",
"content_elements": {
//Each editable content area has one entry below
//If no content areas are defined, a default content area named "body" will be added
"content_area_name": {
"title": "Editable Area Name",
"editor_toolbar": { //(Optional)
"dock": "auto", //Dock position for the Editor Menu and Toolbar :: "top", "top_offset", "bottom", or "auto" (default)
"show_menu": true, //Whether to display the editor menu :: true (default), or false
"show_toolbar": true, //Whether to display the editor toolbar :: true (default), false
// The editor_toolbar "top_offset" dock style uses the same margin-top method as the "page_toolbar" top_offset dock style
},
"type": "htmleditor" //(Optional) - Editable area type - "htmleditor" (default), or "text" for unstyled text
},
//Example:
"body": { "title": "Body" }
},
//(Optional) Default value for each content area. If omitted, the HTML content will be used
"default_content": {
"content_area_name": "Default Content"
},
"properties": { //(Optional) Page Properties fields
"fields": [
//Below are sample field definitions
//Short Format
{ "name": "showTitle", "caption": "Show Title", "default": "Y", "control": "checkbox", "controlparams": { "value_true": "Y", "value_false": "N" } },
{ "name": "bodyClass", "caption": "Body CSS Class", "controlstyle": "width:400px" },
{ "name": "bodyStyle", "caption": "Body CSS Style", "controlstyle": "width:400px" },
//Long format
{ "name": "showTitle", "caption": "Show Title", "type": "varchar", "length": "32", "default": "Y",
"control": "checkbox", "controlparams": { "value_true": "Y", "value_false": "N" } },
{ "name": "bodyClass", "caption": "Body CSS Class", "type": "varchar", "length": 1024,
"control": "textbox", "controlstyle": "width:400px", "validate": ["MaxLength:1024"]},
{ "name": "bodyStyle", "caption": "Body CSS Style", "type": "varchar", "length": 1024,
"control": "textbox", "controlstyle": "width:400px", "validate": ["MaxLength:1024"]},
]
},
"options": { //(Optional)
"title_element_required": true, //(Default true) If set to false, no cms-title element required on the page
"page_toolbar": {
"dock": "top_offset" // Page toolbar dock position
// "top_offset" :: (Default) Dock to top, and add margin-top to <body> and all fixed elements
// "top" :: Dock to top, and do not offset existing content.
// "bottom" :: Dock to bottom
// The following classes are added to the <body> tag during editing for editor-specific styling:
// jsharmony_cms_editor - Always added when viewing a page in the Page Editor
// jsharmony_cms_editing - Added when currently editing a content element
// jsharmony_cms_editing_<content_element_id> - Added when currently editing a content element
},
},
//Advanced Feature - In-memory Templates
"templates": {
"editor": "Template HTML", // Prepended by contents of <templateBaseFileName>.templates.editor.ejs
"publish": "Template HTML", // Prepended by contents of <templateBaseFileName>.templates.publish.ejs
// Export as JSON by setting templates.publish to "format:json"
},
//Advanced Feature - Remote templates
"remote_templates": { //Remote templates downloaded from URLs
//URL parameters are optional
"editor": "https://server/templates/pages/template_name.editor.html?page_key=%%%page_key%%%&page_id=%%%page_id%%%&branch_id=%%%branch_id%%%&page_template_id=%%%page_template_id%%%&_=%%%timestamp%%%",
"publish": "https://server/templates/pages/template_name.publish.html?source=1&_=%%%timestamp%%%"
},
//System-managed Properties - Do not use unless you know what you are doing
"content": { "content_element_name": "..." }, //SYSTEM - Hard-coded content element content.
"components": { "component_name": { /* Component definition */ } }, //SYSTEM - Inline page components
"raw": false, //SYSTEM - Used only on the <Raw Text> template
}