]> sipb.mit.edu Git - ikiwiki.git/blob - doc/templates.mdwn
openid_url was renamed to openid_identifier
[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. 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 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 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 !*.tmpl and !*/discussion"
27 feeds=no archive=yes 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 * `rsspage.tmpl` - Used for generating rss feeds for blogs.
49 * `rssitem.tmpl` - Used for generating individual items on rss feeds.
50 * `atompage.tmpl` - Used for generating atom feeds for blogs.
51 * `atomitem.tmpl` - Used for generating individual items on atom feeds.
52 * `inlinepage.tmpl` - Used for displaying a post in a blog.
53 * `archivepage.tmpl` - Used for listing a page in a blog archive page.
54 * `titlepage.tmpl` - Used for listing a page by title in a blog archive page.
55 * `microblog.tmpl` - Used for showing a microblogging post inline.
56 * `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links)
57 * `feedlink.tmpl` - Used to add rss/atom links if `blogpost.tmpl` is not used.
58 * `aggregatepost.tmpl` - Used by the aggregate plugin to create
59   a page for a post.
60 * `searchform.tmpl`, `googleform.tmpl` - Used by the search plugin 
61   and google plugin to add search forms to wiki pages.
62 * `searchquery.tmpl` - This is a Omega template, used by the
63   search plugin.
64 * `comment.tmpl` - Used by the comments plugin to display a comment.
65 * `change.tmpl` - Used to create a page describing a change made to the wiki.
66 * `recentchanges.tmpl` - Used for listing a change on the RecentChanges page.
67 * `autoindex.tmpl` - Filled in by the autoindex plugin to make index pages.
68 * `autotag.tmpl` - Filled in by the tag plugin to make tag pages.
69 * `calendarmonth.tmpl`, `calendaryear.tmpl` - Used by ikiwiki-calendar to
70   make calendar archive pages.
71 * `editpage.tmpl`, `editconflict.tmpl`, `editcreationconflict.tmpl`,
72   `editfailedsave.tmpl`, `editpagegone.tmpl`, `pocreatepage.tmpl`,
73   `editcomment.tmpl` `commentmoderation.tmpl`, `renamesummary.tmpl`,
74   `passwordmail.tmpl`, `openid-selector.tmpl` - Parts of ikiwiki's user
75   interface; do not normally need to be customised.
76
77 [[!meta robots="noindex, follow"]]