1 I'm trying to create a template to use as a sidebar with links. The template will be static
2 (no variables are used). I first created a page with this directive: \[[!template id=sidebar]],
3 and then created the template with the web interface.
5 This is the code I put in the template:
9 <li>\[[Existing internal link|exists]]</li>
10 <li>\[[Non-existing internal link|doesnotexist]]</li>
11 <li>[External link](http://google.com/)</li>
16 This is the relevant part of the resulting html file `template/sidebar.html`:
20 <li><a href="../exists.html">Existing internal link</a></li>
21 <li><span class="createlink"><a href="http://localhost/cgi-bin/itesohome.cgi?page=doesnotexist&from=templates%2Fsidebar&do=create" rel="nofollow">?</a>Non-existing internal link</span></li>
22 <li>[External link](http://google.com/)</li>
26 Note that the `<http://google.com/>` link has disappeared, and that `[External link](http://google.com/)`
27 has been copied literally instead of being converted to a link, as I expected.
29 > Templates aren't Markdown page. [[ikiwiki/WikiLink]] only are expanded. --[[Jogo]]
31 >> Thanks for the help Jogo. Looking at the [[templates]] page, it says that
32 "...you can include WikiLinks and all other forms of wiki markup in the template." I read this
33 to mean that a template may indeed include Markdown. Am I wrong in my interpratation? --[[buo]]
35 >> I discovered that if I eliminate all html from my sidebar.mdwn template, the links are
36 rendered properly. It seems that the mix of Markdown and html is confusing some part of
39 Worse, this is the relevant part of the html file of the page that includes the template:
43 <li><span class="selflink">Existing internal link</span></li>
44 <li><span class="createlink"><a href="http://localhost/cgi-bin/itesohome.cgi?page=doesnotexist&from=research&do=create" rel="nofollow">?</a>Non-existing internal link</span></li>
45 <li>[External link](http://google.com/)</li>
49 Note that the `Existing internal link` is no longer a link. It is only text.
51 What am I doing wrong? Any help or pointers will be appreciated. --[[buo]]
55 I think I have figured this out. I thought the template was filled and then
56 processed to convert Markdown to html. Instead, the text in each variable is
57 processed and then the template is filled. I somehow misunderstood the
58 [[templates]] page. -- [[buo]]