summaryrefslogtreecommitdiff
path: root/doc/ikiwiki
diff options
context:
space:
mode:
authorhttp://jmtd.livejournal.com/ <http://jmtd.livejournal.com/@web>2010-11-15 14:41:40 +0000
committerJoey Hess <joey@kitenet.net>2010-11-15 14:41:40 +0000
commit62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14 (patch)
tree3f5d9ba0a23adad4ffbd9932cbd56b0aa82d2f27 /doc/ikiwiki
parent9d0ac3170a8f90d2139ef75698e8af21a6435fb4 (diff)
I totally misinterpreted what included() is supposed to be for.
This reverts commit da9e1ea667f82d5fca9168dbed19be08040570ff
Diffstat (limited to 'doc/ikiwiki')
-rw-r--r--doc/ikiwiki/directive/template.mdwn34
1 files changed, 13 insertions, 21 deletions
diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn
index df391f99e..9e3ae54df 100644
--- a/doc/ikiwiki/directive/template.mdwn
+++ b/doc/ikiwiki/directive/template.mdwn
@@ -60,30 +60,22 @@ few things:
`<TMPL_IF variable>text</TMPL_IF>`.
* To use one block of text if a variable is set and a second if it's not,
use `<TMPL_IF variable>text<TMPL_ELSE>other text</TMPL_IF>`
-* Each template file included in the wiki's source will also generate a regular
- wiki page. In many cases you might want to prevent some of your template
- being interpreted for the regular page. Use the [[if]] directive with the
- `included()` test to guard the template code.
Here's a sample template:
- \[[!if test="included()" then="""
- <span class="infobox">
- Name: \[[<TMPL_VAR raw_name>]]<br />
- Age: <TMPL_VAR age><br />
- <TMPL_IF color>
- Favorite color: <TMPL_VAR color><br />
- <TMPL_ELSE>
- No favorite color.<br />
- </TMPL_IF>
- <TMPL_IF notes>
- <hr />
- <TMPL_VAR notes>
- </TMPL_IF>
- </span>
- """ else="""
- This is a template page.
- """]]
+ <span class="infobox">
+ Name: \[[<TMPL_VAR raw_name>]]<br />
+ Age: <TMPL_VAR age><br />
+ <TMPL_IF color>
+ Favorite color: <TMPL_VAR color><br />
+ <TMPL_ELSE>
+ No favorite color.<br />
+ </TMPL_IF>
+ <TMPL_IF notes>
+ <hr />
+ <TMPL_VAR notes>
+ </TMPL_IF>
+ </span>
The filled out template will be formatted the same as the rest of the page
that contains it, so you can include WikiLinks and all other forms of wiki