The user-generated content areas on your pages initially have no content. You can use templates to assign some default content to these cells; when a user first visits a page requesting the cell, it will load the content from the template instead of a blank cell.
Creating A Template
In many ways, a template functions similarly to a cell. To create a template, you simply add a
TemplateService.getTemplateContent call to a page, similar to how you added user-generated content in
step 2 of this guide. A template is edited with the WYSIWYG editor, just like a standard cell.
You may choose add this call via an SSI on pages that are not publicly available, as only moderators have access to edit the content.
Applying A Template To A Cell
To apply a template to a cell, add the optional
templateId parameter to your
CellService.getCellContent,
CellService.getCell, or
CellService.getCellWithChildren Data Access API call. These calls are explained in
step 2 of this guide.
For user-generated pages, be sure to pass in your desired template when you generate your URL. That templateId should be retrievable from your URL when you render your shell page. For more information on user-generated pages, refer to
step 6 of this guide.
Next Step 9: Tell Us About Your Cache