Merge branch 'master' into templatemove
[ikiwiki] / doc / templates.mdwn
1 [[Ikiwiki]] uses many templates for many purposes. By editing its templates,
2 you can fully customise this site.
3
4 Templates are located in `/usr/share/ikiwiki/templates` by default;
5 the `templatedir` setting can be used to make another directory be
6 searched first. Customized templates can also be placed inside the
7 "templates/" directory in your wiki's source.
8
9 Ikiwiki uses the HTML::Template module as its template engine. This
10 supports things like conditionals and loops in templates and is pretty
11 easy to learn. All you really need to know are a few things:
12
13 * To insert the value of a template variable, use `<TMPL_VAR variable>`.
14 * To make a block of text conditional on a variable being set use
15   `<TMPL_IF NAME="variable">text</TMPL_IF>`.
16 * To use one block of text if a variable is set and a second if it's not,
17   use `<TMPL_IF NAME="variable">text<TMPL_ELSE>other text</TMPL_IF>`
18
19 [[!if test="enabled(template)" then="""
20 ## template pages
21
22 The template directive allows wiki pages to be used as templates,
23 filled out and inserted into other pages in the wiki.
24 """]]
25 [[!if test="enabled(template) and enabled(inline)" then="""
26 [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes
27 sort=title template=titlepage
28 rootpage=templates postformtext="Add a new template named:"]]
29 """]]
30
31 [[!if test="enabled(edittemplate)" then="""
32 ## edit templates
33
34 The edittemplate directive can be used to make new pages default to
35 containing text from a template, which can be filled as out the page is
36 edited.
37 """]]
38
39 ## wiki templates
40
41 These templates are used to build the wiki. The aim is to keep almost all
42 html out of ikiwiki and in the templates.
43
44 * `page.tmpl` - Used for displaying all regular wiki pages. This is the
45   key template to customize. [[!if test="enabled(pagetemplate)" then="""
46   (The pagetemplate directive can be used to make a page use a
47   different template than `page.tmpl`.)"""]]
48 * `misc.tmpl` - Generic template used for any page that doesn't
49   have a custom template.
50 * `rsspage.tmpl` - Used for generating rss feeds for blogs.
51 * `rssitem.tmpl` - Used for generating individual items on rss feeds.
52 * `atompage.tmpl` - Used for generating atom feeds for blogs.
53 * `atomitem.tmpl` - Used for generating individual items on atom feeds.
54 * `inlinepage.tmpl` - Used for displaying a post in a blog.
55 * `archivepage.tmpl` - Used for listing a page in a blog archive page.
56 * `titlepage.tmpl` - Used for listing a page by title in a blog archive page.
57 * `microblog.tmpl` - Used for showing a microblogging post inline.
58 * `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links)
59 * `feedlink.tmpl` - Used to add rss/atom links if `blogpost.tmpl` is not used.
60 * `aggregatepost.tmpl` - Used by the aggregate plugin to create
61   a page for a post.
62 * `searchform.tmpl`, `googleform.tmpl` - Used by the search plugin 
63   and google plugin to add search forms to wiki pages.
64 * `searchquery.tmpl` - This is a Omega template, used by the
65   search plugin.
66 * `comment.tmpl` - Used by the comments plugin to display a comment.
67 * `change.tmpl` - Used to create a page describing a change made to the wiki.
68 * `recentchanges.tmpl` - Used for listing a change on the RecentChanges page.
69 * `autoindex.tmpl` - Filled in by the autoindex plugin to make index pages.
70 * `autotag.tmpl` - Filled in by the tag plugin to make tag pages.
71 * `calendarmonth.tmpl`, `calendaryear.tmpl` - Used by ikiwiki-calendar to
72   make calendar archive pages.
73 * `editpage.tmpl`, `editconflict.tmpl`, `editcreationconflict.tmpl`,
74   `editfailedsave.tmpl`, `editpagegone.tmpl`, `pocreatepage.tmpl`,
75   `editcomment.tmpl` `commentmoderation.tmpl`, `renamesummary.tmpl`,
76   `passwordmail.tmpl` - Parts of ikiwiki's user interface; do not
77   normally need to be customised.
78
79 [[!meta robots="noindex, follow"]]