]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/recentchanges/change_62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14._change
(no commit message)
[git.ikiwiki.info.git] / doc / recentchanges / change_62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14._change
1 [[!meta author="""http://jmtd.livejournal.com/"""]]
3 [[!meta authorurl="""http://jmtd.livejournal.com/"""]]
5 [[!meta title="""change to ikiwiki/directive/template on ikiwiki"""]]
7 [[!meta permalink="http://ikiwiki.info/recentchanges/#change-62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14"]]
9 <div id="change-62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14" class="metadata">
10 <span class="desc"><br />Changed pages:</span>
11 <span class="pagelinks">
13 <a href="http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/ikiwiki/directive/template.mdwn;h=9e3ae54dfd6209c92528ace49ad5ae2b3279d486;hp=df391f99e0a23dd7cda85a8c29c1aef80baa707f;hb=62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14;hpb=9d0ac3170a8f90d2139ef75698e8af21a6435fb4" title="diff" rel="nofollow">[[diff|wikiicons/diff.png]]</a><a href="http://ikiwiki.info/ikiwiki.cgi?page=ikiwiki%2Fdirective%2Ftemplate&amp;do=goto" rel="nofollow">ikiwiki/directive/template</a>
16 </span>
17 <span class="desc"><br />Changed by:</span>
18 <span class="committer">
20 <a href="http://jmtd.livejournal.com/" rel="nofollow">jmtd [livejournal.com]</a>
22 </span>
23 <span class="desc"><br />Commit type:</span>
24 <span class="committype">web</span>
25 <span class="desc"><br />Date:</span>
26 <span class="changedate"><span class="relativedate" title="Mon, 15 Nov 2010 10:41:40 -0400">10:41:40 11/15/10</span></span>
27 <span class="desc"><br /></span>
28 </div>
30 <span class="revert">
31 <a href="http://ikiwiki.info/ikiwiki.cgi?rev=62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14&amp;do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
32 </span>
34 <div class="changelog">
37 I totally misinterpreted what included() is supposed to be for.<br />
43 This reverts commit da9e1ea667f82d5fca9168dbed19be08040570ff<br />
46 </div>
48 <div class="diff">
49 <pre>
50 diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn
51 index df391f9..9e3ae54 100644
52 --- a/doc/ikiwiki/directive/template.mdwn
53 +++ b/doc/ikiwiki/directive/template.mdwn
54 @@ -60,30 +60,22 @@ few things:
55    `&lt;TMPL_IF variable&gt;text&lt;/TMPL_IF&gt;`.
56  * To use one block of text if a variable is set and a second if it&#39;s not,
57    use `&lt;TMPL_IF variable&gt;text&lt;TMPL_ELSE&gt;other text&lt;/TMPL_IF&gt;`
58 -* Each template file included in the wiki&#39;s source will also generate a regular
59 -  wiki page.  In many cases you might want to prevent some of your template
60 -  being interpreted for the regular page.  Use the &#91;&#91;if&#93;&#93; directive with the
61 -  `included()` test to guard the template code.
62  
63  Here&#39;s a sample template:
64  
65 -        \&#91;&#91;!if test=&quot;included()&quot; then=&quot;&quot;&quot;
66 -          &lt;span class=&quot;infobox&quot;&gt;
67 -          Name: \&#91;&#91;&lt;TMPL_VAR raw_name&gt;&#93;&#93;&lt;br /&gt;
68 -          Age: &lt;TMPL_VAR age&gt;&lt;br /&gt;
69 -          &lt;TMPL_IF color&gt;
70 -            Favorite color: &lt;TMPL_VAR color&gt;&lt;br /&gt;
71 -          &lt;TMPL_ELSE&gt;
72 -            No favorite color.&lt;br /&gt;
73 -          &lt;/TMPL_IF&gt;
74 -          &lt;TMPL_IF notes&gt;
75 -            &lt;hr /&gt;
76 -            &lt;TMPL_VAR notes&gt;
77 -          &lt;/TMPL_IF&gt;
78 -          &lt;/span&gt;
79 -        &quot;&quot;&quot; else=&quot;&quot;&quot;
80 -          This is a template page.
81 -        &quot;&quot;&quot;&#93;&#93;
82 +        &lt;span class=&quot;infobox&quot;&gt;
83 +        Name: \&#91;&#91;&lt;TMPL_VAR raw_name&gt;&#93;&#93;&lt;br /&gt;
84 +        Age: &lt;TMPL_VAR age&gt;&lt;br /&gt;
85 +        &lt;TMPL_IF color&gt;
86 +        Favorite color: &lt;TMPL_VAR color&gt;&lt;br /&gt;
87 +        &lt;TMPL_ELSE&gt;
88 +        No favorite color.&lt;br /&gt;
89 +        &lt;/TMPL_IF&gt;
90 +        &lt;TMPL_IF notes&gt;
91 +        &lt;hr /&gt;
92 +        &lt;TMPL_VAR notes&gt;
93 +        &lt;/TMPL_IF&gt;
94 +        &lt;/span&gt;
95  
96  The filled out template will be formatted the same as the rest of the page
97  that contains it, so you can include WikiLinks and all other forms of wiki
99 </pre>
100 </div>
102 <!-- 62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14 -->