summaryrefslogtreecommitdiff
path: root/doc/recentchanges/change_62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14._change
blob: b784d2250fe53b11c68d9c07c83d93bb8a0ea0bc (plain)
  1. [[!meta author="""http://jmtd.livejournal.com/"""]]
  2. [[!meta authorurl="""http://jmtd.livejournal.com/"""]]
  3. [[!meta title="""change to ikiwiki/directive/template on ikiwiki"""]]
  4. [[!meta permalink="http://ikiwiki.info/recentchanges/#change-62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14"]]
  5. <div id="change-62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14" class="metadata">
  6. <span class="desc"><br />Changed pages:</span>
  7. <span class="pagelinks">
  8. <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>
  9. </span>
  10. <span class="desc"><br />Changed by:</span>
  11. <span class="committer">
  12. <a href="http://jmtd.livejournal.com/" rel="nofollow">jmtd [livejournal.com]</a>
  13. </span>
  14. <span class="desc"><br />Commit type:</span>
  15. <span class="committype">web</span>
  16. <span class="desc"><br />Date:</span>
  17. <span class="changedate"><span class="relativedate" title="Mon, 15 Nov 2010 10:41:40 -0400">10:41:40 11/15/10</span></span>
  18. <span class="desc"><br /></span>
  19. </div>
  20. <span class="revert">
  21. <a href="http://ikiwiki.info/ikiwiki.cgi?rev=62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14&amp;do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
  22. </span>
  23. <div class="changelog">
  24. I totally misinterpreted what included() is supposed to be for.<br />
  25. This reverts commit da9e1ea667f82d5fca9168dbed19be08040570ff<br />
  26. </div>
  27. <div class="diff">
  28. <pre>
  29. diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn
  30. index df391f9..9e3ae54 100644
  31. --- a/doc/ikiwiki/directive/template.mdwn
  32. +++ b/doc/ikiwiki/directive/template.mdwn
  33. @@ -60,30 +60,22 @@ few things:
  34. `&lt;TMPL_IF variable&gt;text&lt;/TMPL_IF&gt;`.
  35. * To use one block of text if a variable is set and a second if it&#39;s not,
  36. use `&lt;TMPL_IF variable&gt;text&lt;TMPL_ELSE&gt;other text&lt;/TMPL_IF&gt;`
  37. -* Each template file included in the wiki&#39;s source will also generate a regular
  38. - wiki page. In many cases you might want to prevent some of your template
  39. - being interpreted for the regular page. Use the &#91;&#91;if&#93;&#93; directive with the
  40. - `included()` test to guard the template code.
  41. Here&#39;s a sample template:
  42. - \&#91;&#91;!if test=&quot;included()&quot; then=&quot;&quot;&quot;
  43. - &lt;span class=&quot;infobox&quot;&gt;
  44. - Name: \&#91;&#91;&lt;TMPL_VAR raw_name&gt;&#93;&#93;&lt;br /&gt;
  45. - Age: &lt;TMPL_VAR age&gt;&lt;br /&gt;
  46. - &lt;TMPL_IF color&gt;
  47. - Favorite color: &lt;TMPL_VAR color&gt;&lt;br /&gt;
  48. - &lt;TMPL_ELSE&gt;
  49. - No favorite color.&lt;br /&gt;
  50. - &lt;/TMPL_IF&gt;
  51. - &lt;TMPL_IF notes&gt;
  52. - &lt;hr /&gt;
  53. - &lt;TMPL_VAR notes&gt;
  54. - &lt;/TMPL_IF&gt;
  55. - &lt;/span&gt;
  56. - &quot;&quot;&quot; else=&quot;&quot;&quot;
  57. - This is a template page.
  58. - &quot;&quot;&quot;&#93;&#93;
  59. + &lt;span class=&quot;infobox&quot;&gt;
  60. + Name: \&#91;&#91;&lt;TMPL_VAR raw_name&gt;&#93;&#93;&lt;br /&gt;
  61. + Age: &lt;TMPL_VAR age&gt;&lt;br /&gt;
  62. + &lt;TMPL_IF color&gt;
  63. + Favorite color: &lt;TMPL_VAR color&gt;&lt;br /&gt;
  64. + &lt;TMPL_ELSE&gt;
  65. + No favorite color.&lt;br /&gt;
  66. + &lt;/TMPL_IF&gt;
  67. + &lt;TMPL_IF notes&gt;
  68. + &lt;hr /&gt;
  69. + &lt;TMPL_VAR notes&gt;
  70. + &lt;/TMPL_IF&gt;
  71. + &lt;/span&gt;
  72. The filled out template will be formatted the same as the rest of the page
  73. that contains it, so you can include WikiLinks and all other forms of wiki
  74. </pre>
  75. </div>
  76. <!-- 62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14 -->