Skip to content

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:

text
[[module Rate]]

A module with a body has a closing tag. The body is a template that the module fills in:

text
[[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: perPage and perpage are 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:

text
[[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:

text
/page-name/key/value/other-key/other-value

Keys 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.

MessageMeaning
The module name does not existNo module has this name, or the module is not available here
An error occurred while processing the module nameThe module could not run with the values given
Module processing is disabledThe 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 ​

ModuleBodyPurpose
ListPagesYesList pages selected by category, tags, dates, ratings and more
CountPagesYesCount pages selected the same way as ListPages
PagesByTagNoList pages that carry one tag
TagCloudNoShow all tags sized by use
WantedPagesNoList links that point to pages that do not exist
NextPage and PreviousPageYesLink to the next or previous page in the same category
ListUsersYesShow the current reader, or the authors of the page
MembersYesList user accounts, optionally by role
SiteChangesNoRecent edits across the site, with filters
RateNoRating widget for the page
AuthorRankNoRanks authors by the total rating of their pages
ForumStartNoForum sections and categories
ForumCategoryNoThreads in one forum category
ForumThreadNoPosts in one thread
ForumNewThreadNoForm to start a thread
RecentPostsNoLatest forum posts
FrontForumYesForum threads shown as news items
NewPageNoForm to create a page
SearchNoSite search box with filters
FilesNoTable of the page's attachments
GalleryNoThumbnails of the page's image attachments
CSSYesAdd CSS to the page
NoThemeNoLeave out the site theme or the base styles
ThemePreviewerNoReplace the site theme with a stylesheet at a given address
PageDescriptionYesSet the description used in link previews
PageImageNoSet the image used in link previews
RedirectNoSend readers to another address
ButtonNoEdit or tag button
InputYesForm controls without a submit action
ApplicationFormNoSubmit a support ticket or membership application
MembershipByPasswordNoJoin a role with a password
MembershipQuizNoJoin a role by passing a quiz
CommentsNoLink to the page's comments
TimeYesCurrent 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.

text
[[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 ​

ParameterValuesMeaning
fullnamea 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 ​

ParameterValuesDefaultMeaning
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.
pagetypenormal, hidden, *normalnormal: 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.
tagssee Tags*Filters on tags.
parent-, =, -=, ., a full page namenone-: 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_toa full page name, or .nonePages that link to the named page. . is the current page.
created_bya user name, wd:name, ., = or -=nonePages 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_atsee DatesnoneFilters on the creation time.
updated_atsee DatesnoneFilters on the time of the last edit.
ratinga number with an optional operator, or =noneFilters on the rating.
votesa whole number with an optional operator, or =noneFilters on the number of votes.
popularitya whole number with an optional operator, or =noneFilters on popularity (percentage of positive votes).
_fielda value with an optional operatornoneFilters 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 ​

ValueMeaning
*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 listTags 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:tag for 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.

text
[[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 .:

text
2021        2021-02        2021.02        2021-02-09        >=2021-02        <>2021

Dates are read in the site time zone; see Site administration. The operators mean:

ValueSelects pages whose time is
2021 or =2021within 2021: from 2021-01-01 00:00, before 2022-01-01 00:00
2021-02within February 2021: from 2021-02-01 00:00, before 2021-03-01 00:00
2021-02-09within 9 February 2021: from 2021-02-09 00:00, before 2021-02-10 00:00
<>2021outside 2021: before 2021-01-01 00:00, or from 2022-01-01 00:00
>2021after 2021: from 2022-01-01 00:00
>=2021from the start of 2021: from 2021-01-01 00:00
<2021before 2021: before 2021-01-01 00:00
<=2021up 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.

FieldOrders by
created_atCreation time
updated_atTime of the last edit
created_byAuthor account name. A page with several authors appears once for each author.
namePage name without category
fullnameFull page name
titleTitle
ratingRating
votesNumber of votes
popularityPopularity
sizeLength of the current source
revisionsNumber of history entries
commentsNumber of posts in the page's comments
randomRandom order; the direction is ignored
_fieldA 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 ​

ParameterValuesDefaultMeaning
offsetwhole number0Skip this many pages at the start.
limitwhole numbernoneShow at most this many pages in total.
perPagewhole number20Pages per list page, at most 250. 0 or less shows no pages.
reverseswitchfalseReverse the order of the pages on the current list page.
urlAttrPrefixtextnonePut 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 ​

ParameterValuesDefaultMeaning
rsstextnoneTitle of the feed. When set, a feed link appears above the list.
rssDescriptiontextnoneDescription of the feed.
rssHomepage namethe page the list is onHome page the feed points to.
rssLimitwhole numberthe smaller of limit and perPagePages in the feed, at most 250.
rssOnlyswitchfalseShow 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 ​

ParameterValuesDefaultMeaning
prependLinewikitextnoneRendered once before the pages. Variables are not replaced.
appendLinewikitextnoneRendered once after the pages. Variables are not replaced.
separateswitchtrueOn: 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.
wrapperswitchtrueOn: 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.
tagTargetpage namesystem:page-tagsPage that %%tags_linked%% links point to: /<tagTarget>/tag/<tag>.

A table built from a list:

text
[[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:

text
[[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:

text
[[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:

VariableValue
%%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):

VariableValue
%%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):

VariableValue
%%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:

VariableValue
%%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:

VariableValue
%%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.

VariableValue
%%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:

VariableValue
%%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:

VariableValue
%%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.

text
[[form]]
fields:
  status:
    type: select
    label: Status
    values:
      open: Open
      done: Done
  priority:
    label: Priority
[[/form]]

A page in that category:

text
status: done
priority: 02

These variables can be used in the list body and take the values of the listed page:

VariableValue
%%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:

text
[[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" includes 10; 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:

WrittenRead as
datecreated_at
categoriescategory
tagtags
order="dateCreatedAsc", dateCreatedDesccreated_at, created_at desc
order="dateEditedAsc", dateEditedDescupdated_at, updated_at desc
order="titleAsc", titleDesctitle, title desc
order="ratingAsc", ratingDescrating, rating desc
order="pageLengthAsc", pageLengthDescsize, size desc
rssTitlerss

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.

ParameterValuesDefaultDescription
bydate, titledatedate: by creation time, so the next page is the one created later. title: by title.
categoryCategory names separated by spaces or commas; * for every categoryThe category of the current pageWhere to look.
tagsAs for ListPagesnoneOnly 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:

text
[[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.

VariableValue
%%total%%, %%count%%Number of pages (not case-sensitive)
text
[[module CountPages category="scp" tags="+euclid"]]
There are %%total%% Euclid pages.
[[/module]]

PagesByTag ​

Lists the pages that carry one tag, sorted by title.

ParameterValuesDefaultMeaning
taga tag name, or category:tagnoneThe 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.

text
[[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.

ParameterValuesDefaultMeaning
limitwhole number, 0 or moreallInclude only this many of the most-used tags. A value that cannot be read shows an error.
minFontSize, maxFontSizesize with a unit, such as 80% or 12px100%, 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,b128,128,192, 64,64,128Colors for the least- and most-used tags. Give both; if only one is given, both defaults are used.
targetpage namesystem:page-tagsTag links go to /<target>/tag/<tag>.
categoriesyesnoneGroup 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.

text
[[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.

ParameterValuesDefaultMeaning
category_fromas category in ListPages.Categories of the pages that contain the links.
category_toas category in ListPages*Categories of the missing pages.
perPagewhole number20Rows 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.

text
[[module WantedPages category_from="*" category_to="-fragment"]]

Users ​

ListUsers ​

Shows information about the reader, or about the authors of the current page.

ParameterValuesDefaultMeaning
alwaysswitchfalseRender the body for readers who are not signed in. Without it, the module shows nothing to them.
anonnametext"Anonymous" in square bracketsName used for a reader who is not signed in.
authorsswitchfalseRender the body once for each author of the current page instead.

Variables for the reader (not case-sensitive):

VariableSigned inNot signed in
%%number%%User ID-1
%%title%%, %%user_displayname%%Display name, or account name when there is noneanonname
%%name%%, %%user_name%%Account nameanonname
%%avatar%%Avatar addressDefault avatar address
%%is_authenticated%%truefalse

Variables with authors="yes":

VariableValue
%%author%%Author's display name; imported Wikidot accounts get a wd: prefix
%%author_linked%%Author as a user link
text
[[module ListUsers always="yes"]]
[[if %%is_authenticated%%]]
Signed in as %%title%%.
[[else]]
Not signed in.
[[/if]]
[[/module]]
text
[[module ListUsers authors="yes"]]
%%author_linked%%
[[/module]]

Members ​

Lists user accounts in order of user ID, one body per account. Deactivated accounts are included.

ParameterValuesDefaultMeaning
rolerole Identifier or role IDall accountsOnly accounts that have this role. An unknown role shows an error.
perPagewhole number100Accounts per list page, at most 250.
limitwhole number100Used when perPage is not given.
prependLinewikitextnoneRendered once before all accounts. %%total%% can be used.
appendLinewikitextnoneRendered once after all accounts. %%total%% can be used.

Variables (not case-sensitive):

VariableValue
%%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.

text
[[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:

KeyValuesMeaning
categorycategory name, or *Category filter
usernameaccount name, or ~partUser filter. Changes made by the system are included when the name is system, or with ~ when the text is part of the word system.
perpagewhole number greater than 0Items per list page, default 20
pwhole numberList page
a change typetrueShow 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:

KeyFlagLabel
sourceSPage content changed
titleTTitle changed
nameRPage renamed or deleted
tagsATags changed
newNNew page created
parentMParent page changed
file_added, file_deleted, file_renamedFFile added / File deleted / File renamed
votes_deletedVVotes changed
authorshipCAuthors changed
wikidotWEdit 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.

text
[[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.

text
[[module Rate]]
ParameterDefaultDescription
favouritenoWith yes, a favourite button and the number of favourites follow the rating widget. Not shown either when the rating system is Off.
text
[[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]].

ParameterValuesDefaultMeaning
categorycategory names, separated by spaces or commasall categoriesCount only pages in these categories. A name starting with - leaves that category out.
tagstags, separated by spaces or commasanyCount only pages carrying at least one of these tags. A tag starting with - works as if it were in exclude.
negatetags, separated by spaces or commasnonePages with these tags count with their rating reversed. The pages' own ratings do not change.
excludetags, separated by spaces or commasnonePages with these tags do not count.
perPage or limitwhole number50Authors per list page, at most 250.
prependLinewikitextthe default header when the body is emptyRendered once before all authors.
appendLinewikitextnoneRendered once after all authors.
usera username or display namenonePicks a user for the %%user_…%% variables. It does not change which authors are listed. An unknown user shows an error.
rowsswitchtrueWhen off, no authors are listed and there is no paging. Only prependLine and appendLine are rendered.

Variables in the body (not case-sensitive):

VariableValue
%%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:

VariableValue
%%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:

text
[[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:

text
[[module AuthorRank negate="dv至上" exclude="基础"]]
[[/module]]

Show one user's row in bold:

text
[[module AuthorRank user="Kakushi" prependLine="||~ Place||~ Author||~ Score||"]]
||[[#if %%is_user%% | **%%rank%%** | %%rank%%]]||%%author_linked%%||%%score%%||
[[/module]]

Show only one user's place:

text
[[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:

text
[[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:

text
[[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:

AddressPageModule
/forum/startforum:startForumStart
/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-threadForumNewThread
/forum:recent-postsforum:recent-postsRecentPosts

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 keyMeaning
sShow only this section. An unknown section gives a 404 status.
hiddenshow also lists hidden sections

ForumCategory ​

Lists the threads of one forum category, pinned threads first. It has no parameters.

Address keyMeaning
cCategory ID. Unknown or missing: 404 status.
sortstart orders by thread creation time; otherwise by last reply time
pList 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.

ParameterValuesDefaultMeaning
contentonlyyesnoneShow only the posts: no breadcrumbs, description, thread options or reply form.
Address keyMeaning
tThread ID. Unknown or missing: 404 status.
pList page
postPost 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 keyMeaning
cCategory 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 keyMeaning
cCategory ID. A value that is not a number empties the drop-down and the list.
pList 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.

ParameterValuesDefaultMeaning
categorycategory IDs separated by ;requiredCategories to take threads from. IDs that do not exist are skipped. Without any ID, the module shows an error.
limitwhole number20Number of threads, at most 250. 0 shows none.
offsetwhole number0Skip 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):

VariableValue
%%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:

text
+ %%linked_title%%

%%author%% 发表于 %%date|%O前(%Y年%b%e日 %H:%M)%%

%%content%%

%%comments%% 条回复 | 分类:%%category%%

Readers without the permission to view forum categories see nothing.

text
[[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.

ParameterValuesDefaultMeaning
categorycategory namenoneThe new page is created in this category: the name entered becomes category:name.
exampletextnonePlaceholder text shown in the empty box.
submittext"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.

text
[[module NewPage category="draft" example="my-idea" submit="Start a draft"]]

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.

ParameterValuesDefaultMeaning
placeholdertextA prompt to search page titles or contentPlaceholder in the search box
qtextnoneInitial search words
tagstagsnoneInitial value of the tag filter
categorycategory namenoneInitial value of the category filter
Address keyMeaning
qInitial search words; takes precedence over the q parameter
authorInitial author filter
datefrom, datetoInitial date range, as YYYY-MM-DD
text
[[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.

text
[[module Files]]

Shows thumbnails of the current page's image attachments.

ParameterValuesDefaultMeaning
sizesquare, thumbnail, small, mediummediumsquare: 75 × 75, cropped. thumbnail: 100 on the longer side. small: 240. medium: 500. Any other value shows an error.
viewerswitch valueonWhen 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:

text
[[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.

text
[[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.

ParameterDescription
scopesite (default) leaves out the site theme; all also leaves out the Wikidot base styles
text
[[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.

ParameterDescription
theme_urlAddress of the stylesheet, starting with http://, https:// or /. Without it, only the site theme is left out
noUiAccepted and ignored. The module shows no theme picker
text
[[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.

text
[[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.

ParameterValuesDefaultMeaning
srcan address, or page-name/filenoneA 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.
text
[[module PageImage src="main/cover.png"]]

Redirect ​

Sends readers to another address with an HTTP redirect when they open the page.

ParameterValuesDefaultMeaning
destinationan addressnoneWhere to send readers. Addresses using javascript: or data: are refused with an error.
noredirectswitchfalseTurn the redirect off.

To view or edit a page that redirects, open it with /noredirect/true added to its address.

text
[[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.

FormAction
[[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.
ParameterValuesDefaultMeaning
texttextthe button typeButton label. Spaces at the start and end are removed.
text
[[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.

PropertyValuesDefaultMeaning
titletextthe field nameLabel
typetext, textarea, select, checkboxtextControl type
sizewhole number30Width of a text box
defaulttextnoneInitial value. For a checkbox, 1, yes, true or checked ticks it. For a select, the option key.
hinttextnoneHelp text under the control
optionskey: labelnoneOne option of a select; repeat for each option

[[input]] ... [[/input]] is a shorthand for this module:

text
[[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).

ParameterValuesDefaultMeaning
type or kindmembershipapply, anything elseticketmembershipapply sends a membership application; any other value sends a ticket.
title or subjectswitch or textsubject field shownA 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.

text
[[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.

ParameterValuesDefaultMeaning
label or texttext"Enter password"Label of the password field
text
[[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.

text
[[module MembershipQuiz]]

Comments ​

Places a link to the current page's comments. It has no parameters.

text
[[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.

VariableValue
%%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.

text
[[module Time]]
© 2019–%%currentyear%% Example Wiki
[[/module]]

This is the only module that works in the site footer license text.