source: branches/mbutscher/work/WikidPadHelp/data/Templates.wiki @ 195

Last change on this file since 195 was 178, checked in by mbutscher, 11 years ago

2.0preAlpha (internal)

Works so far, now editing help wiki.

File size: 1.6 KB
Line 
1++ Templates
2
3If a non-existing page has only one parent which has a "template" attribute, the initial content of the new page will be taken from the page pointed to by the attribute.
4
5The new page will (as always) only be created effectively after it is modified in some way.
6
7
8Example:
9
10Let's assume you want to record things you have bought,
11each article on it's own page.
12
13
14So at first create a template page: BoughtTemplate.
15
16Then define this as a root page which uses the template:
17[template: BoughtTemplate].
18
19Be sure to save the wiki now as template pages will always taken as they are stored in the database, not as they are written in an editor.
20
21
22Now you can create subpages:
23
24    * ArticleFoobaromatic (this is already created)
25    * ArticleStopAndGoer (go to this to see the template)
26    * NotBoughtAlsoTemplate (or to this page)
27
28
29
30You can enhance this example using [FormPages].
31
32
33+++ Automatic heading replacement
34
35As you might have noticed in the above examples, the heading at the top of the newly created pages was set automatically according to the name of the page like you are used to it for new, non-templated pages.
36
37If you instead want to keep the heading of the template or don't want a heading at all, you can write \[template_head: manual] on the template page (in the example this is BoughtTemplate).
38
39If you want to disable the automatic heading replacement for all templates of a wiki, you can place \[global.template_head: manual] on an arbitrary page of the wiki. To activate then the heading replacement for a particular template, use \[template_head: auto] on the template page.
40
Note: See TracBrowser for help on using the repository browser.