Version User Scope of changes
May 1 2008, 1:59 PM EDT DevinCanterberry 2 words added, 2 words deleted
Apr 25 2008, 3:33 PM EDT ryan_wetpaint 129 words added, 55 words deleted

Changes

Key:  Additions   Deletions

Data Access API CallTemplateService.getTemplateTemplateService.getTemplateContentReturns a template and its content.

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.getTemplateTemplateService.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 WikiService.getCellContent, WikiService.getCell, or WikiService.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.