]> sipb.mit.edu Git - ikiwiki.git/blob - doc/templates.mdwn
`themes.pm` instead of `themes.mdwn`
[ikiwiki.git] / 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. Customised 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 to modify templates is this:
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 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 variable>text<TMPL_ELSE>other text</TMPL_IF>`
18
19 [[!if test="enabled(template)" then="""
20 ## template pages
21
22 The [[!iki ikiwiki/directive/template desc="template directive"]] allows
23 wiki pages to be used as templates, filled out and inserted into other
24 pages in the wiki.
25 """]]
26
27 [[!if test="enabled(edittemplate)" then="""
28 ## default content for new pages
29
30 The [[!iki ikiwiki/directive/edittemplate desc="edittemplate directive"]] can
31 be used to make new pages default to containing text from a template
32 page, which can be filled as out the page is edited.
33 """]]
34
35 [[!if test="(enabled(template) or enabled(edittemplate))
36 and enabled(inline)" then="""
37 [[!inline pages="templates/* and !*.tmpl and !templates/*/* and !*/discussion"
38 feeds=no archive=yes sort=title template=titlepage
39 rootpage=templates postformtext="Add a new template named:"]]
40 """]]
41
42 ## wiki templates
43
44 These templates are used to build the wiki. The aim is to keep almost all
45 html out of ikiwiki and in the templates.
46
47 * `page.tmpl` - Used for displaying all regular wiki pages. This is the
48   key template to customise. [[!if test="enabled(pagetemplate)" then="""
49   (The [[!iki ikiwiki/directive/pagetemplate desc="pagetemplate directive"]]
50   can be used to make a page use a different template than `page.tmpl`.)"""]]
51 * `rsspage.tmpl` - Used for generating rss feeds for blogs.
52 * `rssitem.tmpl` - Used for generating individual items on rss feeds.
53 * `atompage.tmpl` - Used for generating atom feeds for blogs.
54 * `atomitem.tmpl` - Used for generating individual items on atom feeds.
55 * `inlinepage.tmpl` - Used for displaying a post in a blog.
56 * `archivepage.tmpl` - Used for listing a page in a blog archive page.
57 * `titlepage.tmpl` - Used for listing a page by title in a blog archive page.
58 * `microblog.tmpl` - Used for showing a microblogging post inline.
59 * `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links)
60 * `feedlink.tmpl` - Used to add rss/atom links if `blogpost.tmpl` is not used.
61 * `aggregatepost.tmpl` - Used by the aggregate plugin to create
62   a page for a post.
63 * `searchform.tmpl`, `googleform.tmpl` - Used by the search plugin 
64   and google plugin to add search forms to wiki pages.
65 * `searchquery.tmpl` - This is a Omega template, used by the
66   search plugin.
67 * `comment.tmpl` - Used by the comments plugin to display a comment.
68 * `change.tmpl` - Used to create a page describing a change made to the wiki.
69 * `recentchanges.tmpl` - Used for listing a change on the RecentChanges page.
70 * `autoindex.tmpl` - Filled in by the autoindex plugin to make index pages.
71 * `autotag.tmpl` - Filled in by the tag plugin to make tag pages.
72 * `calendarmonth.tmpl`, `calendaryear.tmpl` - Used by ikiwiki-calendar to
73   make calendar archive pages.
74 * `editpage.tmpl`, `editconflict.tmpl`, `editcreationconflict.tmpl`,
75   `editfailedsave.tmpl`, `editpagegone.tmpl`, `pocreatepage.tmpl`,
76   `editcomment.tmpl` `commentmoderation.tmpl`, `renamesummary.tmpl`,
77   `passwordmail.tmpl`, `openid-selector.tmpl` - Parts of ikiwiki's user
78   interface; do not normally need to be customised.
79
80 [[!meta robots="noindex, follow"]]