With MindTouch Deki you can create single and multiple page templates and then use the templates to create pre-formatted pages of content. It's really easy.
A template is a piece of content, stored in a page of its own (a 'template page'), which can be included in another wiki page using a simple syntax. The template can be considered like a function in a programming language, in that you define it in one place, and then can reference it from others.
A template can contain:
You can either add a template to a page in the editor, or you can call templates dynamically from your page using the Template DekiScript command.
Templates are useful for quickly creating similarly formatted pages of content. For example, perhaps every project you do has a similar set of pages. Project summary, timeline, people, meeting notes, etc. By creating a project template it makes creating new project pages quick and easy. Templates also help to provide some level of consistency in pages.
If you want to include the same text on each page (such as the popular "This page is a stub" template), consider using a template. For a user to type {{ Template.stub() }} is much quicker than to type out the entire, formatted string; it means the string appears exactly the same on each page, and it can be edited later.
Click to Tools > Templates. Alternatively you may browse to http://yourdeki_wiki/Template: , e.g.- Template: This page lists all the templates available. There may be templates here already - you may browse them by clicking the links to each template. If you haven't created any templates yet, you'll see a page named "Templates" and the text "Page has no text." Let's create a new template now.
Click "New Page". This creates a new page titled "Template:Page Title". Add content to the template. Change the title of your template to be something indicative of its use. Click "Save". If you like to create a multiple page template, add additional sub-pages to this template by clicking "New Page". Add content to these pages and click "Save".
To create a page from a template, create a new page - not in the template namespace (i.e. Template:), but somewhere you wish to take advantage of the template. You might like to start in a sandbox page while learning. While editing this page click the template icon on the editor toolbar - it looks like this (red arrow is pointing to the template icon):
Editor toolbar
You will then see a list of all the templates available. Select your template. If you select a single page template the contents of this template are injected into the page you are editing. If you selected a multiple page template a list of all the pages, with links to each page, is injected into the page you are editing. Click save.
Here's where the fun starts!
To call a template from a page, such that the content is added when the page is viewed, not when the page is saved, enter something like this:
{{ Template.Name() }}
Here's an example, showing the Daily Dilbert template:

This was included automatically like this:
{{ Template.DailyDilbert() }}
To call a template with parameters, you usually provide a "map", or key/value pairing. The StockInfo template takes a parameter "ticker", with a value of a stock symbol. Instead of parenthesis, you can use curly brackets to include a map. Let's call the StockInfo template with the parameter "ticker" set to the symbol for Apple:
{{ Template.StockInfo{ ticker:"AAPL" } }}
Any function which can be written in DekiScript on a page can be put into a template.
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| Template_icon.png The red arrow points to the template icon on the editor toolbar. | 7.73 kB | 21:29, 23 Nov 2008 | crb | Actions | ||
| Template_icon_FCKEditor.png No description | 7.73 kB | 21:32, 23 Nov 2008 | crb | Actions | ||
| Images 2 | ||
|---|---|---|
The red arrow points to the template icon on the editor toolbar.Template_icon.png | ||