Modules
Modules add dynamic content to a page: lists of pages, ratings, the forum, forms, site activity and more. This document lists every module ProjectWikit provides, with its parameters and examples. For general wikitext, see Syntax.
Placing a module
A module without a body is written on one line:
[[module Rate]]A module with a body has a closing tag. The body is a template that the module fills in:
[[module ListPages category="news" limit="5"]]
* %%title_linked%%
[[/module]]- Module names are case-insensitive:
[[module ListPages]],[[module listpages]]and[[module LISTPAGES]]are the same. - Parameter names are case-insensitive:
perPageandperpageare the same. Parameter values are case-sensitive unless a module says otherwise. - Put values in double quotes:
category="news". - Parameters a module does not list are ignored.
[[module654 ...]]is accepted as another spelling of[[module ...]].- Except for Button, a module's output is a block of its own. Written in the middle of a sentence, it still starts on a new line.
Where modules work
- In page content, including pages pulled in with
[[include]]and category templates (category:_template). A module in an included page acts on the page that includes it. For example,[[module Rate]]in an included component rates the including page. - Not in forum posts.
- In the site footer license text (see Site administration), only
[[module Time]]works.
Modules inside modules
A module body can contain other modules, including ones with a body of their own:
[[module ListUsers]]
[[module CSS]]
#header { background-image: url(%%avatar%%); }
[[/module]]
[[/module]]The outer module replaces its variables in the whole body before the inner module runs. If both modules know a variable of the same name, the outer value wins. [[module ListUsers]] offers %%user_displayname%% and %%user_name%% for this case, so it can be used inside [[module ListPages]].
A [[module ListPages]] nested more than 10 levels deep stops with an error.
Switch values
Parameters described as a switch accept true, yes, t or 1 for on, and false, no, f or 0 for off, in any letter case. Any other value leaves the default.
Values from the page address
Several modules read values from the page address. Everything after the page name is read as key/value pairs:
/page-name/key/value/other-key/other-valueKeys are case-insensitive. For example, /forum/c-3/p/2 shows page 2 of forum category 3.
Errors
When a module cannot run, the page shows an error block in its place and the rest of the page renders normally.
| Message | Meaning |
|---|---|
| The module name does not exist | No module has this name, or the module is not available here |
| An error occurred while processing the module name | The module could not run with the values given |
| Module processing is disabled | The page was opened with /nomodule/true |
If a module breaks a page, open the page with /nomodule/true added to its address, for example /main/nomodule/true. No module on the page then runs.
Module index
| Module | Body | Purpose |
|---|---|---|
| ListPages | Yes | List pages selected by category, tags, dates, ratings and more |
| CountPages | Yes | Count pages selected the same way as ListPages |
| PagesByTag | No | List pages that carry one tag |
| TagCloud | No | Show all tags sized by use |
| WantedPages | No | List links that point to pages that do not exist |
| NextPage and PreviousPage | Yes | Link to the next or previous page in the same category |
| ListUsers | Yes | Show the current reader, or the authors of the page |
| Members | Yes | List user accounts, optionally by role |
| SiteChanges | No | Recent edits across the site, with filters |
| Rate | No | Rating widget for the page |
| AuthorRank | No | Ranks authors by the total rating of their pages |
| ForumStart | No | Forum sections and categories |
| ForumCategory | No | Threads in one forum category |
| ForumThread | No | Posts in one thread |
| ForumNewThread | No | Form to start a thread |
| RecentPosts | No | Latest forum posts |
| FrontForum | Yes | Forum threads shown as news items |
| NewPage | No | Form to create a page |
| Search | No | Site search box with filters |
| Files | No | Table of the page's attachments |
| Gallery | No | Thumbnails of the page's image attachments |
| CSS | Yes | Add CSS to the page |
| NoTheme | No | Leave out the site theme or the base styles |
| ThemePreviewer | No | Replace the site theme with a stylesheet at a given address |
| PageDescription | Yes | Set the description used in link previews |
| PageImage | No | Set the image used in link previews |
| Redirect | No | Send readers to another address |
| Button | No | Edit or tag button |
| Input | Yes | Form controls without a submit action |
| ApplicationForm | No | Submit a support ticket or membership application |
| MembershipByPassword | No | Join a role with a password |
| MembershipQuiz | No | Join a role by passing a quiz |
| Comments | No | Link to the page's comments |
| Time | Yes | Current date and time in the reader's time zone |
Page lists
ListPages
Selects pages and renders the body once for each page, replacing variables such as %%title%% with that page's values.
[[module ListPages category="*" order="updated_at desc" limit="10"]]
* %%title_linked%% (%%rating%%), edited %%updated_at%%
[[/module]]Without a body, nothing is shown for each page. Pages in categories the reader is not allowed to view are never listed.
Choosing a single page
| Parameter | Values | Meaning |
|---|---|---|
fullname | a full page name, or . | Only this page. . is the current page. All other selection parameters are ignored. |
name | . | Only the current page. All other selection parameters are ignored. |
range | ., others, before, after | .: only the current page; all other selection parameters are ignored. others: the pages selected by the other parameters, without the current page. before and after: the pages that come before or after the current page in the sort order, without the current page. No other value is recognized. |
Selecting pages
| Parameter | Values | Default | Meaning |
|---|---|---|---|
category | *, ., names | . | *: all categories. .: the current page's category. Otherwise a list of category names separated by spaces or commas; -name excludes a category, . in the list means the current category. The main category is _default. |
pagetype | normal, hidden, * | normal | normal: names that do not start with _. hidden: only names that start with _. Any other value: both. |
name | *, =, prefix*, prefix%, a name | * | Filters on the page name without its category. =: the same name as the current page. abc* or abc%: names starting with abc. Otherwise an exact name. |
tags | see Tags | * | Filters on tags. |
parent | -, =, -=, ., a full page name | none | -: pages without a parent. =: pages with the same parent as the current page. -=: pages whose parent differs from the current page's. .: children of the current page. A full name: children of that page. |
link_to | a full page name, or . | none | Pages that link to the named page. . is the current page. |
created_by | a user name, wd:name, ., = or -= | none | Pages the user is an author of. wd:name names an imported Wikidot account. . is the reader; a reader who is not signed in gets no pages. =: pages sharing an author with the current page. -=: pages sharing no author with it. |
created_at | see Dates | none | Filters on the creation time. |
updated_at | see Dates | none | Filters on the time of the last edit. |
rating | a number with an optional operator, or = | none | Filters on the rating. |
votes | a whole number with an optional operator, or = | none | Filters on the number of votes. |
popularity | a whole number with an optional operator, or = | none | Filters on popularity (percentage of positive votes). |
_field | a value with an optional operator | none | Filters on a data form field. See Data form fields. |
A value that names nothing (an unknown parent page, an unknown user, a date or number that cannot be read) makes the list empty.
For rating, votes and popularity, the operators are =, <>, >, >=, < and <=, written before the value: rating=">=10". A value without an operator means =. The value = alone means "equal to the current page's value". Ratings are the sum of votes on sites or categories using Upvote/downvote, and the average on those using Stars. Rating filters and rating order use the rating system of the first category named in category, or of _default when none is named.
Tags
| Value | Meaning |
|---|---|
* | No tag filter (default) |
- | Pages without any tags |
= | Pages that have every tag of the current page, and possibly more |
== | Pages that have exactly the tags of the current page, no more and no fewer. On a page without tags: pages without any tags |
| a list | Tags separated by spaces or commas, see below |
In a list:
+tag: the page must have this tag.-tag: the page must not have this tag.tag: the page must have at least one of the tags written this way.- Write
category:tagfor a tag in a tag category.
Tag names are matched in lowercase. If a +tag does not exist on the site, or none of the plain tags exist, the list is empty. A -tag that does not exist is ignored.
[[module ListPages category="*" tags="+euclid -archived"]]Dates
created_at and updated_at take a year, a month or a day, with an optional operator in front. The parts can also be separated with .:
2021 2021-02 2021.02 2021-02-09 >=2021-02 <>2021Dates are read in the site time zone; see Site administration. The operators mean:
| Value | Selects pages whose time is |
|---|---|
2021 or =2021 | within 2021: from 2021-01-01 00:00, before 2022-01-01 00:00 |
2021-02 | within February 2021: from 2021-02-01 00:00, before 2021-03-01 00:00 |
2021-02-09 | within 9 February 2021: from 2021-02-09 00:00, before 2021-02-10 00:00 |
<>2021 | outside 2021: before 2021-01-01 00:00, or from 2022-01-01 00:00 |
>2021 | after 2021: from 2022-01-01 00:00 |
>=2021 | from the start of 2021: from 2021-01-01 00:00 |
<2021 | before 2021: before 2021-01-01 00:00 |
<=2021 | up to the end of 2021: before 2022-01-01 00:00 |
= | within the day of the current page |
Each parameter takes one condition. created_at=">=2021-02-08" selects pages created on or after 8 February 2021, and updated_at="<2021-03" selects pages last edited before March 2021.
The year must be between 1 and 9999. A month or day outside its range is moved to the nearest valid value, so 2021-13-99 is read as 2021-12-31. Any other text makes the list empty.
Time counted back from now also works: last 3 day selects pages from the past 3 days, and older than 2 week pages from before 2 weeks ago. The units are hour, day, week and month (an s may be added), and a missing number counts as 1.
Order
order takes a field name, optionally followed by a space and desc for descending order. Write both words in lowercase. The default is created_at desc.
| Field | Orders by |
|---|---|
created_at | Creation time |
updated_at | Time of the last edit |
created_by | Author account name. A page with several authors appears once for each author. |
name | Page name without category |
fullname | Full page name |
title | Title |
rating | Rating |
votes | Number of votes |
popularity | Popularity |
size | Length of the current source |
revisions | Number of history entries |
comments | Number of posts in the page's comments |
random | Random order; the direction is ignored |
_field | A data form field. Numbers sort by value, anything else as text. _field::integer is accepted and works the same |
Any other field lists the newest pages first. reverse only reverses the order within the current list page.
Limits and pagination
| Parameter | Values | Default | Meaning |
|---|---|---|---|
offset | whole number | 0 | Skip this many pages at the start. |
limit | whole number | none | Show at most this many pages in total. |
perPage | whole number | 20 | Pages per list page, at most 250. 0 or less shows no pages. |
reverse | switch | false | Reverse the order of the pages on the current list page. |
urlAttrPrefix | text | none | Put in front of every key this list reads from the address, including the pager's p. |
When the selected pages do not fit on one list page, a pager appears below the list. Its links are ordinary addresses of the form /page-name/p/2, so a list page can be linked to directly. Lists on the same page without urlAttrPrefix share the p value; a list with urlAttrPrefix="a_" uses /page-name/a_p/2 instead, and its @URL values read keys starting with a_.
RSS
| Parameter | Values | Default | Meaning |
|---|---|---|---|
rss | text | none | Title of the feed. When set, a feed link appears above the list. |
rssDescription | text | none | Description of the feed. |
rssHome | page name | the page the list is on | Home page the feed points to. |
rssLimit | whole number | the smaller of limit and perPage | Pages in the feed, at most 250. |
rssOnly | switch | false | Show only the feed link, without the list. |
The feed lists what a visitor who is not signed in may see, and ignores created_at. Each entry's description is its %%preview%%.
Formatting
| Parameter | Values | Default | Meaning |
|---|---|---|---|
prependLine | wikitext | none | Rendered once before the pages. Variables are not replaced. |
appendLine | wikitext | none | Rendered once after the pages. Variables are not replaced. |
separate | switch | true | On: each page's body, prependLine and appendLine are rendered separately, and [[iftags]], [[ifcategory]] and images in the body refer to the listed page. Off: everything is joined into one piece of wikitext first, which is required for building a table across rows; [[iftags]] and [[ifcategory]] then refer to the page the list is on. |
wrapper | switch | true | On: the list is wrapped in a div with the class list-pages-box and gets a pager. Off: no wrapper and no pager; only the first list page (or the one named by p in the address) is shown. |
tagTarget | page name | system:page-tags | Page that %%tags_linked%% links point to: /<tagTarget>/tag/<tag>. |
A table built from a list:
[[module ListPages category="*" tags="+featured" order="rating desc" separate="false" prependLine="||~ Page ||~ Rating ||~ Created ||"]]
|| %%title_linked%% || %%rating%% || %%created_at|%Y-%m-%d%% ||
[[/module]]Instead of prependLine and appendLine, the body can be split into [[head]], [[body]] and [[foot]] sections. They must appear in this order, and [[body]] must be present when the others are used. Line breaks right after an opening tag and right before a closing tag are removed:
[[module ListPages category="news" perPage="5"]]
[[head]]
++ Latest news
[[/head]]
[[body]]
* %%title_linked%%
[[/body]]
[[foot]]
[[[news:archive|All news]]]
[[/foot]]
[[/module]]Values from the address
Any parameter value can be taken from the page address with @URL|default. The module uses the address value with the same key as the parameter, or default when the address has none:
[[module ListPages category="@URL|sandbox"]]
* %%title_linked%%
[[/module]]Opened as /page-name/category/drafts, this lists pages in drafts; opened as /page-name, it lists pages in sandbox. This works in ListPages and CountPages.
Variables
Variables are written as %%name%% and are case-sensitive: %%Title%% is not replaced. A variable that has no value for a page is left unchanged unless stated otherwise. The same variables are available in category templates (category:_template).
Page:
| Variable | Value |
|---|---|
%%name%% | Page name without category |
%%category%% | Category (_default for the main category) |
%%fullname%% | Full page name; no category prefix for the main category |
%%title%% | Title |
%%title_linked%%, %%linked_title%% | Link to the page showing its title |
%%link%% | / followed by the page title. It matches the page address only when the title equals the page name. |
%%content%% | The page's current source |
%%content{n}%% | Section n of the source, counting from 1. Sections are separated by a line of four or more = characters. A section that does not exist gives an empty value. |
%%size%% | Number of characters in the current source |
%%revisions%% | Number of history entries |
%%children%% | Number of child pages |
%%index%% | Position in the list, counting from 1 and continuing across list pages |
%%total%% | Number of pages selected, not capped by limit |
%%limit%% | The limit parameter; empty when not given |
%%total_or_limit%% | Number of pages in the list: the smaller of %%total%% and limit |
%%preview%%, %%preview(n)%% | The first 200, or n, characters of the page text, without formatting or modules |
%%summary%%, %%first_paragraph%% | The first paragraph of the page text |
Parent page (left unchanged when the page has no parent):
| Variable | Value |
|---|---|
%%parent_name%%, %%parent_category%%, %%parent_fullname%%, %%parent_title%% | The parent's name, category, full name and title |
%%parent_title_linked%%, %%parent_linked_title%% | Link to the parent showing its title |
Dates (shown in the reader's time zone):
| Variable | Value |
|---|---|
%%created_at%% | Creation time |
%%updated_at%% | Time of the last edit |
%%created_at|format%%, %%updated_at|format%% | The same, with a [[date]] format, for example %%created_at|%Y-%m-%d%% |
People:
| Variable | Value |
|---|---|
%%created_by%% | Authors' display names, separated by spaces. Imported Wikidot accounts get a wd: prefix. |
%%created_by_unix%% | Authors' account names |
%%created_by_id%% | Authors' user IDs |
%%created_by_linked%% | Authors as user links with avatars |
%%created_by_linked_plain%% | Authors as user links without avatars |
%%authors_count%% | Number of authors |
%%updated_by%%, %%updated_by_unix%%, %%updated_by_id%%, %%updated_by_linked%%, %%updated_by_linked_plain%% | The same for the last editor. Without an editor, the text and link forms show the system account label System. |
Ratings:
| Variable | Value |
|---|---|
%%rating%% | Upvote/downvote: the sum with a sign, such as +12. Stars: the average with one decimal, or — without votes. Rating turned off: 0. |
%%rating_votes%% | Number of votes |
%%rating_percent%% | Stars only: the average as a percentage of 5. Otherwise 0. |
%%popularity%% | Percentage of positive votes (up votes, or star votes of 3.0 and above). 0 when rating is turned off. |
%%current_user_voted%% | True or False |
Tags. Tags are lowercase and sorted. Tags whose full name starts with _ are hidden tags.
| Variable | Value |
|---|---|
%%tags%% | Visible tags, separated by spaces |
%%_tags%% | Hidden tags only |
%%alltags%% | All tags |
%%tags_linked%%, %%_tags_linked%%, %%alltags_linked%% | The same as links, separated by commas. Links go to /system:page-tags/tag/<tag>, or to the page set with tagTarget. |
%%tags_linked|prefix%% (also with _tags and alltags) | Links go to prefix followed by the tag. A prefix that does not start with /, http:// or https:// gets a / in front. |
Comments:
| Variable | Value |
|---|---|
%%comments%% | Number of posts in the page's comments |
%%commented_at%% | Time of the last post; empty when there are no posts |
%%commented_by%%, %%commented_by_unix%%, %%commented_by_id%%, %%commented_by_linked%% | Author of the last post; empty when there are no posts |
Site:
| Variable | Value |
|---|---|
%%site_name%% | Site identifier |
%%site_title%% | Site title |
%%site_domain%% | Site domain |
When a list shows %%content%%, modules in the listed pages run as well. A [[module CSS]] in a listed page styles the page the list is on, and a [[module Redirect]] in a listed page redirects it.
In a category template, variables in a [[module ListPages]] body take the values of the listed pages, and variables in its parameters take the values of the page being displayed. For example, parent="%%fullname%%" lists the children of the page being displayed.
Data form fields
A category whose _template page contains a [[form]] block is a data form category, and its pages are filled in through a form. See Data form categories for creating the form, the field types and editing.
[[form]]
fields:
status:
type: select
label: Status
values:
open: Open
done: Done
priority:
label: Priority
[[/form]]A page in that category:
status: done
priority: 02These variables can be used in the list body and take the values of the listed page:
| Variable | Value |
|---|---|
%%form_data{field}%% | The field value prepared for display. A select shows the option's text, a checkbox is 0 or 1, wiki and static are rendered as wikitext, and anything else is shown as typed. |
%%form_raw{field}%% | The stored value, unchanged |
%%form_label{field}%% | The field's label |
%%form_hint{field}%% | The field's hint |
ListPages can filter and order by fields with an underscore in front of the field name:
[[module ListPages category="projects" _status="=done" order="_priority desc"]]
* %%title_linked%%: %%form_data{status}%%
[[/module]]- The operators are
=,<>,>,>=,<and<=.=ignores letter case. When both sides are numbers they compare by value, so_priority=">9"includes10; otherwise text is compared character by character. - A checkbox field is written
_field="1"for ticked or_field="0"for not ticked. - A page in a category without a form never matches a field condition.
- Filtering by fields reads every page that matches the other parameters, so it is slower on large categories.
Older parameter names
These old parameter names are accepted:
| Written | Read as |
|---|---|
date | created_at |
categories | category |
tag | tags |
order="dateCreatedAsc", dateCreatedDesc | created_at, created_at desc |
order="dateEditedAsc", dateEditedDesc | updated_at, updated_at desc |
order="titleAsc", titleDesc | title, title desc |
order="ratingAsc", ratingDesc | rating, rating desc |
order="pageLengthAsc", pageLengthDesc | size, size desc |
rssTitle | rss |
These old variable names are accepted too: %%page_name%% (%%name%%), %%page_unix_name%% and %%full_page_name%% (%%fullname%%), %%author%% (%%created_by%%), %%author_edited%% and %%user_edited%% (%%updated_by%%), %%date%% (%%created_at%%), %%date_edited%% (%%updated_at%%), %%description%% and %%short%% (%%summary%%), and %%text%%, %%long%% and %%body%% (%%content%%).
skipCurrent="true" leaves the current page out, like range="others", when range is not given.
NextPage and PreviousPage
[[module NextPage]] shows the next page in the same category and [[module PreviousPage]] the previous one. The body is written as for ListPages, and its variables take the values of the neighbouring page. Nothing is shown when there is no such page.
| Parameter | Values | Default | Description |
|---|---|---|---|
by | date, title | date | date: by creation time, so the next page is the one created later. title: by title. |
category | Category names separated by spaces or commas; * for every category | The category of the current page | Where to look. |
tags | As for ListPages | none | Only pages that match the tags are considered. |
With an empty body, a link to the neighbouring page is shown. They are often placed in a category template to give every page previous and next links:
[[div style="float: left; width: 45%"]]
[[module PreviousPage]]
Previous: %%linked_title%%
[[/module]]
[[/div]]
[[div style="float: right; width: 45%; text-align: right"]]
[[module NextPage]]
Next: %%linked_title%%
[[/module]]
[[/div]]CountPages
Counts the pages selected by the same parameters as ListPages and renders the body once. perPage has no effect; offset and limit do. @URL|default values work.
| Variable | Value |
|---|---|
%%total%%, %%count%% | Number of pages (not case-sensitive) |
[[module CountPages category="scp" tags="+euclid"]]
There are %%total%% Euclid pages.
[[/module]]PagesByTag
Lists the pages that carry one tag, sorted by title.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
tag | a tag name, or category:tag | none | The tag. A tag value in the page address (/page-name/tag/euclid) takes precedence. |
Without a tag, or when the tag category does not exist, the module shows nothing. Tag names are not case-sensitive. Pages in categories the reader cannot view are left out.
[[module PagesByTag]]Placed on system:page-tags, this lists the pages for the tag in the address, which is where TagCloud links point by default.
TagCloud
Shows every tag on the site, with more-used tags larger and darker. Tags are sorted by name without their category. Tags whose name starts with _ are never shown.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
limit | whole number, 0 or more | all | Include only this many of the most-used tags. A value that cannot be read shows an error. |
minFontSize, maxFontSize | size with a unit, such as 80% or 12px | 100%, 300% | Font sizes for the least- and most-used tags. Give both, with the same unit; if only one is given, both defaults are used. |
minColor, maxColor | #rgb, #rrggbb, rgb(r,g,b) or r,g,b | 128,128,192, 64,64,128 | Colors for the least- and most-used tags. Give both; if only one is given, both defaults are used. |
target | page name | system:page-tags | Tag links go to /<target>/tag/<tag>. |
categories | yes | none | Group tags by tag category in collapsible blocks, ordered by the tag category's Priority. |
Sizes are read as a whole number followed by a unit: 1.5em is read as 1 with the unit .5em. Use whole numbers, such as 150%. A size that does not start with a number, two sizes with different units, or a color that cannot be read shows an error.
[[module TagCloud limit="50" minFontSize="80%" maxFontSize="200%" categories="yes"]]WantedPages
Lists links that point to pages that do not exist, in a table with the pages that contain them.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
category_from | as category in ListPages | . | Categories of the pages that contain the links. |
category_to | as category in ListPages | * | Categories of the missing pages. |
perPage | whole number | 20 | Rows per list page, at most 250. |
The source pages can be narrowed further with the other ListPages selection parameters, such as tags or parent. limit and offset are ignored.
[[module WantedPages category_from="*" category_to="-fragment"]]Users
ListUsers
Shows information about the reader, or about the authors of the current page.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
always | switch | false | Render the body for readers who are not signed in. Without it, the module shows nothing to them. |
anonname | text | "Anonymous" in square brackets | Name used for a reader who is not signed in. |
authors | switch | false | Render the body once for each author of the current page instead. |
Variables for the reader (not case-sensitive):
| Variable | Signed in | Not signed in |
|---|---|---|
%%number%% | User ID | -1 |
%%title%%, %%user_displayname%% | Display name, or account name when there is none | anonname |
%%name%%, %%user_name%% | Account name | anonname |
%%avatar%% | Avatar address | Default avatar address |
%%is_authenticated%% | true | false |
Variables with authors="yes":
| Variable | Value |
|---|---|
%%author%% | Author's display name; imported Wikidot accounts get a wd: prefix |
%%author_linked%% | Author as a user link |
[[module ListUsers always="yes"]]
[[if %%is_authenticated%%]]
Signed in as %%title%%.
[[else]]
Not signed in.
[[/if]]
[[/module]][[module ListUsers authors="yes"]]
%%author_linked%%
[[/module]]Members
Lists user accounts in order of user ID, one body per account. Deactivated accounts are included.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
role | role Identifier or role ID | all accounts | Only accounts that have this role. An unknown role shows an error. |
perPage | whole number | 100 | Accounts per list page, at most 250. |
limit | whole number | 100 | Used when perPage is not given. |
prependLine | wikitext | none | Rendered once before all accounts. %%total%% can be used. |
appendLine | wikitext | none | Rendered once after all accounts. %%total%% can be used. |
Variables (not case-sensitive):
| Variable | Value |
|---|---|
%%members%%, %%member%% | User link with avatar |
%%time%% | Registration time |
%%number%% | User ID |
%%name%% | Account name |
%%title%% | Display name, or account name when there is none |
%%index%% | Position, counting from 1 and continuing across list pages |
%%total%% | Number of accounts listed |
Paging uses p in the address.
[[module Members role="staff" perPage="20"]]
|| %%index%% || %%members%% || %%time%% ||
[[/module]]Site activity
SiteChanges
Shows recent changes across the site, newest first. It has no parameters; the filters are set with the form above the list or in the page address.
Address keys:
| Key | Values | Meaning |
|---|---|---|
category | category name, or * | Category filter |
username | account name, or ~part | User filter. Changes made by the system are included when the name is system, or with ~ when the text is part of the word system. |
perpage | whole number greater than 0 | Items per list page, default 20 |
p | whole number | List page |
| a change type | true | Show this type |
category, username, perpage and the change type keys must have a value. A key without one, or a perpage that is not a positive number, shows an error.
Change types and flags:
| Key | Flag | Label |
|---|---|---|
source | S | Page content changed |
title | T | Title changed |
name | R | Page renamed or deleted |
tags | A | Tags changed |
new | N | New page created |
parent | M | Parent page changed |
file_added, file_deleted, file_renamed | F | File added / File deleted / File renamed |
votes_deleted | V | Votes changed |
authorship | C | Authors changed |
wikidot | W | Edit imported from Wikidot |
A revert is flagged with the types it undid and is included when any of those types is selected. The key revert selects reverts only.
[[module SiteChanges]]Example address: /system:recent-changes/source/true/username/~ali/perpage/50.
Ratings
Rate
Shows the rating widget for the current page. The style follows the Rating system set for the site or the page's category (see Site administration); when it is Off, nothing is shown. Voting requires the permission to rate pages.
[[module Rate]]| Parameter | Default | Description |
|---|---|---|
favourite | no | With yes, a favourite button and the number of favourites follow the rating widget. Not shown either when the rating system is Off. |
[[module Rate favourite="yes"]]Readers can also rate with the Rate button below the page, and favorite it with the Favorite button, whether or not the page contains this module (see Features).
AuthorRank
Lists authors ranked by the total rating of all their pages. Categories the reader cannot view are left out.
The body is one row per author. Once its variables are filled in, the rows are joined with prependLine and appendLine into one piece of wikitext and rendered together, so the rows can form a table. With an empty body, the module shows a table of place, author, score and pages. The module must be closed with [[/module]].
| Parameter | Values | Default | Meaning |
|---|---|---|---|
category | category names, separated by spaces or commas | all categories | Count only pages in these categories. A name starting with - leaves that category out. |
tags | tags, separated by spaces or commas | any | Count only pages carrying at least one of these tags. A tag starting with - works as if it were in exclude. |
negate | tags, separated by spaces or commas | none | Pages with these tags count with their rating reversed. The pages' own ratings do not change. |
exclude | tags, separated by spaces or commas | none | Pages with these tags do not count. |
perPage or limit | whole number | 50 | Authors per list page, at most 250. |
prependLine | wikitext | the default header when the body is empty | Rendered once before all authors. |
appendLine | wikitext | none | Rendered once after all authors. |
user | a username or display name | none | Picks a user for the %%user_…%% variables. It does not change which authors are listed. An unknown user shows an error. |
rows | switch | true | When off, no authors are listed and there is no paging. Only prependLine and appendLine are rendered. |
Variables in the body (not case-sensitive):
| Variable | Value |
|---|---|
%%rank%% | Place. Authors with the same score share a place. |
%%index%% | Position, counting from 1 and continuing across list pages, never shared |
%%author%% | Display name |
%%author_linked%% | User link with avatar |
%%author_name%% | Account name |
%%score%% | Total score, with + before a positive number |
%%pages%% | Number of pages counted |
%%is_user%% | true when this author is the user picked with user, otherwise false |
Variables in the body, prependLine and appendLine:
| Variable | Value |
|---|---|
%%total%% | Number of ranked authors |
%%user_linked%% | The user picked with user, as a user link with avatar |
%%user_rank%%, %%user_index%%, %%user_score%%, %%user_pages%% | That user's place, position, score and number of pages. Empty when none of their pages count. |
%%user_ranked%% | true when that user has a place, otherwise false |
Without user, the %%user_…%% variables are left as they are. With [[#if]], a user without a place can be shown other text. Paging uses p in the address.
Count only pages tagged “原创” that are not in the archived category, with a custom header:
[[module AuthorRank category="-archived" tags="原创" perPage="20" prependLine="||~ Place||~ Author||~ Score||~ Pages||"]]
||%%rank%%||%%author_linked%%||%%score%%||%%pages%%||
[[/module]]Pages tagged “dv至上” count with their rating reversed, and pages tagged “基础” do not count:
[[module AuthorRank negate="dv至上" exclude="基础"]]
[[/module]]Show one user's row in bold:
[[module AuthorRank user="Kakushi" prependLine="||~ Place||~ Author||~ Score||"]]
||[[#if %%is_user%% | **%%rank%%** | %%rank%%]]||%%author_linked%%||%%score%%||
[[/module]]Show only one user's place:
[[module AuthorRank user="Kakushi" rows="false" prependLine="%%user_linked%% [[#if %%user_ranked%% | is ranked %%user_rank%% with %%user_score%% | is not ranked yet]]"]]
[[/module]]Show readers their own place. The outer ListUsers replaces %%name%% with the reader's account name, and readers who are not signed in do not see it:
[[module ListUsers]]
[[module AuthorRank user="%%name%%" rows="false" prependLine="You are ranked %%user_rank%% of %%total%% authors"]]
[[/module]]
[[/module]]List the whole ranking, with the reader's own place below the table:
[[module ListUsers]]
[[module AuthorRank user="%%name%%" prependLine="||~ Place||~ Author||~ Score||" appendLine="You are ranked %%user_rank%%"]]
||%%rank%%||%%author_linked%%||%%score%%||
[[/module]]
[[/module]]Forum
The forum is made of system pages that contain the forum modules. pwikit seed writes these pages for a new site (see Command line). Forum addresses are rewritten to these pages:
| Address | Page | Module |
|---|---|---|
/forum/start | forum:start | ForumStart |
/forum/s-<id> | forum:start/s/<id> | ForumStart |
/forum/c-<id> | forum:category/c/<id> | ForumCategory |
/forum/t-<id> | forum:thread/t/<id> | ForumThread |
/forum:new-thread/c/<id> | forum:new-thread | ForumNewThread |
/forum:recent-posts | forum:recent-posts | RecentPosts |
A name after the ID, as in /forum/t-12/my-thread, is for readability only. Put other keys directly after the ID: /forum/c-3/p/2. The forum modules also set the page title. Using the forum is described in Features.
ForumStart
Lists forum sections and their categories. Sections without any visible category are not shown. It has no parameters.
| Address key | Meaning |
|---|---|
s | Show only this section. An unknown section gives a 404 status. |
hidden | show also lists hidden sections |
ForumCategory
Lists the threads of one forum category, pinned threads first. It has no parameters.
| Address key | Meaning |
|---|---|
c | Category ID. Unknown or missing: 404 status. |
sort | start orders by thread creation time; otherwise by last reply time |
p | List page |
Viewing requires the permission to view the forum category. The category used for page comments shows no Create a new thread link.
ForumThread
Shows the posts of one thread, with replies under the post they answer. Replying, editing and deleting depend on permissions.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
contentonly | yes | none | Show only the posts: no breadcrumbs, description, thread options or reply form. |
| Address key | Meaning |
|---|---|
t | Thread ID. Unknown or missing: 404 status. |
p | List page |
post | Post ID; opens the list page that contains this post |
ForumNewThread
Shows the form for starting a thread in a forum category. It has no parameters.
| Address key | Meaning |
|---|---|
c | Category ID. Unknown or missing: 404 status. |
RecentPosts
Lists the newest forum posts. A drop-down above the list limits it to one forum category. It has no parameters.
| Address key | Meaning |
|---|---|
c | Category ID. A value that is not a number empties the drop-down and the list. |
p | List page |
When the site has a category for page comments, a list not limited to one forum category also includes page comments.
FrontForum
Shows threads from forum categories as news items, newest first, one body per thread. The first post of each thread supplies the content. Pinned threads keep their place in date order. There is no pager.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
category | category IDs separated by ; | required | Categories to take threads from. IDs that do not exist are skipped. Without any ID, the module shows an error. |
limit | whole number | 20 | Number of threads, at most 250. 0 shows none. |
offset | whole number | 0 | Skip this many threads. |
Category IDs appear in forum addresses: /forum/c-3/news is category 3. feed, feedTitle, fixRelativeLinks, separate and order are not supported.
Variables (case-sensitive):
| Variable | Value |
|---|---|
%%title%% | Thread title |
%%linked_title%%, %%title_linked%% | Link to the thread |
%%link%% | Thread address |
%%author%% | Link to the thread's author |
%%date%% | Thread creation time |
%%date|format%% | The same with a [[date]] format |
%%comments%% | Number of replies (posts minus the first) |
%%category%% | Link to the forum category |
%%content%%, %%text%%, %%long%%, %%body%% | Source of the first post |
%%description%%, %%short%%, %%summary%% | The first 200 characters of the first post as plain text |
Without a body, the default format of the site language is used. In Chinese it is:
+ %%linked_title%%
%%author%% 发表于 %%date|%O前(%Y年%b%e日 %H:%M)%%
%%content%%
%%comments%% 条回复 | 分类:%%category%%Readers without the permission to view forum categories see nothing.
[[module FrontForum category="3;7" limit="5"]]
++ %%linked_title%%
%%date|%Y-%m-%d%% · %%author%%
%%summary%%
[[/module]]ForumPost and ForumNewPost
These are used by the thread page for loading, editing, replying to and previewing posts. They cannot be placed on a page; writing them shows a message that the module does not exist.
Creating pages and searching
NewPage
Shows a text box and a button for creating a page.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
category | category name | none | The new page is created in this category: the name entered becomes category:name. |
example | text | none | Placeholder text shown in the empty box. |
submit | text | "Create page" | Button label. An empty value gives an empty button. |
On submit, the name is converted to a page name the same way a link is. If the name can be used and the page does not exist yet, the browser opens the editor for the new page.
[[module NewPage category="draft" example="my-idea" submit="Start a draft"]]Search
Shows the site search, with author, tag, category and date range filters. Results are listed newest first.
A page matches when its text contains every word entered. The author filter accepts an account name, an imported Wikidot account name or a display name. In the tag field, -tag excludes a tag. The date range compares creation dates as whole days in UTC, not in the site time zone. Pages, categories and tags excluded from search in the admin panel are never shown.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
placeholder | text | A prompt to search page titles or content | Placeholder in the search box |
q | text | none | Initial search words |
tags | tags | none | Initial value of the tag filter |
category | category name | none | Initial value of the category filter |
| Address key | Meaning |
|---|---|
q | Initial search words; takes precedence over the q parameter |
author | Initial author filter |
datefrom, dateto | Initial date range, as YYYY-MM-DD |
[[module Search]]Example address: /search:site/q/archive/author/alice.
Attachments
Files
Shows a table of the current page's attachments with their MIME types and sizes, and a link for managing attachments. It has no parameters.
[[module Files]]Gallery
Shows thumbnails of the current page's image attachments.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
size | square, thumbnail, small, medium | medium | square: 75 × 75, cropped. thumbnail: 100 on the longer side. small: 240. medium: 500. Any other value shows an error. |
viewer | switch value | on | When off, clicking a thumbnail does not enlarge it. |
To show chosen images instead of every attachment, use the [[gallery]]…[[/gallery]] list form; see Galleries.
[[gallery]] is a shorthand for this module:
[[gallery size="small"]]The shorthand is replaced everywhere in the page source, including inside [[code]] blocks.
Page settings and styling
CSS
Adds the body as CSS to the page. The CSS is always placed in the page head, wherever the module appears, so its position on the page does not affect which rules win. It has no parameters; a head parameter is accepted and ignored.
[[module CSS]]
#page-title { color: purple; }
[[/module]]A [[module CSS]] in an included page, or in a page shown with %%content%% in a list, also applies to the page that shows it.
NoTheme
Leaves the site theme off the page, so the page can load its own theme with [[module CSS]] without clashing with the site theme.
| Parameter | Description |
|---|---|
scope | site (default) leaves out the site theme; all also leaves out the Wikidot base styles |
[[module NoTheme scope="all"]]A [[module NoTheme]] in an included page also applies to the page that shows it, so it can go in a theme component.
ThemePreviewer
Leaves the site theme off the page and loads the stylesheet at theme_url instead. It works the same as [[module NoTheme scope="site"]] plus a [[module CSS]] that pulls the stylesheet in with @import, and is there for Wikidot pages written this way.
| Parameter | Description |
|---|---|
theme_url | Address of the stylesheet, starting with http://, https:// or /. Without it, only the site theme is left out |
noUi | Accepted and ignored. The module shows no theme picker |
[[module ThemePreviewer noUi="true" theme_url="https://example.com/theme.css"]]PageDescription
Sets the page description used in link previews (the og:description tag) to the body text. Without this module, the start of the page text is used. It shows nothing on the page.
[[module PageDescription]]
A short summary of this page for link previews.
[[/module]]PageImage
Sets the image used in link previews (the og:image tag). It shows nothing on the page.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
src | an address, or page-name/file | none | A full address (containing //) is used as it is. page-name/file.png points to an attachment of that page on the media domain. A bare file name without / is used as it is and is not resolved to an attachment of the current page. |
[[module PageImage src="main/cover.png"]]Redirect
Sends readers to another address with an HTTP redirect when they open the page.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
destination | an address | none | Where to send readers. Addresses using javascript: or data: are refused with an error. |
noredirect | switch | false | Turn the redirect off. |
To view or edit a page that redirects, open it with /noredirect/true added to its address.
[[module Redirect destination="/scp-1730"]]A Redirect in an included page, or in a page shown with %%content%% in a list, redirects the page that shows it.
Buttons and forms
Button
Shows a button that acts on the current page. Several buttons can stand side by side in a line of text.
| Form | Action |
|---|---|
[[button edit]] | Opens the editor. Shown for a page that does not exist (through a _404 template page), opens the editor for creating that page. |
[[button set-tags +tag -tag]] | Adds and removes tags, then reloads the page. A tag written without + or - is added. |
| Parameter | Values | Default | Meaning |
|---|---|---|---|
text | text | the button type | Button label. Spaces at the start and end are removed. |
[[button edit text="Edit this page"]] [[button set-tags +reviewed -needs-review text="Mark reviewed"]]Other types show an error. Changing tags needs the permission to tag pages; otherwise an error message appears. The long form [[module Button type="set-tags" tags="+a -b" text="…"]] is equivalent. The [[button ...]] shorthand is replaced everywhere in the page source, including inside [[code]] blocks.
Every button has the class wiki-standalone-button and a data-button-type attribute with its type, which themes can use for styling.
Input
Shows form controls that are not sent anywhere. It is meant for controls that drive CSS, such as a dark-mode checkbox styled with :has(input.checkbox:checked). The output uses the class mailform-box so that themes written for Wikidot's MailForm keep working, but [[module MailForm]] itself is not available.
The body defines fields. A line starting with # starts a field and names it; lines starting with * set its properties as property: value.
| Property | Values | Default | Meaning |
|---|---|---|---|
title | text | the field name | Label |
type | text, textarea, select, checkbox | text | Control type |
size | whole number | 30 | Width of a text box |
default | text | none | Initial value. For a checkbox, 1, yes, true or checked ticks it. For a select, the option key. |
hint | text | none | Help text under the control |
options | key: label | none | One option of a select; repeat for each option |
[[input]] ... [[/input]] is a shorthand for this module:
[[div class="dark-mode-button"]]
[[input]]
# dark
* title: Dark mode
* type: checkbox
[[/input]]
[[/div]]A body without fields shows an error. The shorthand is replaced everywhere in the page source, including inside [[code]] blocks.
ApplicationForm
Shows a form for sending a support ticket or a membership application to the site staff, who handle them under Support tickets or Membership applications in the admin panel (see Site administration).
| Parameter | Values | Default | Meaning |
|---|---|---|---|
type or kind | membershipapply, anything else | ticket | membershipapply sends a membership application; any other value sends a ticket. |
title or subject | switch or text | subject field shown | A switch turns the subject field on or off. Any other text hides the field and uses the text as the subject. |
The body is required and may be up to 20,000 characters; the subject up to 200. Submitting requires signing in.
A subject of the literal words yes or no cannot be set, because those words act as the switch.
[[module ApplicationForm type="membershipapply" title="Membership application"]][[module MembershipApply]] does the same as the line above, and also takes title or subject to change the subject.
MembershipByPassword
Shows a password field. A signed-in reader who enters the correct password receives a role. The password and the role are set under Membership by password in the site settings (see Site administration). When joining with a password is turned off, the module shows nothing. Entering the password requires signing in.
| Parameter | Values | Default | Meaning |
|---|---|---|---|
label or text | text | "Enter password" | Label of the password field |
[[module MembershipByPassword label="Invitation password"]]MembershipQuiz
Shows the membership quiz. A signed-in reader who answers every question correctly receives a role. The questions, the role, the number of tries and the cooldown are set under Membership quiz in the admin panel (see Site administration). When the quiz is turned off, the module shows nothing. The module has no parameters.
[[module MembershipQuiz]]Comments
Places a link to the current page's comments. It has no parameters.
[[module Comments]]Time
Time
Replaces date and time variables in the body with the current time, shown in the reader's time zone. Values are zero-padded.
| Variable | Value |
|---|---|
%%currentyear%% | Year |
%%currentmonth%% | Month, 01–12 |
%%currentday%% | Day, 01–31 |
%%currenthour%% | Hour, 00–23 |
%%currentminute%% | Minute |
%%currentsecond%% | Second |
Variables are not case-sensitive, and the spelling curent (one r) is also accepted.
[[module Time]]
© 2019–%%currentyear%% Example Wiki
[[/module]]This is the only module that works in the site footer license text.
