Things you can do using the PageForms extension

Overview

PageForms (formerly Semantic Forms) is a MediaWiki extension that lets you build HTML‑like forms for creating, editing and querying wiki pages. It works on its own, or together with Semantic MediaWiki or Cargo, and is especially handy for infobox‑style data.

Core capabilities

  • Form‑driven page creation: define a Form: page, map its fields to template parameters, and let users fill the form instead of writing wikitext.
  • "Edit with form" tab: add #default_form=MyForm to any page so the standard edit link is replaced by a form‑based editor.
  • Query forms: use Special:RunQuery to build a form that returns a list of pages matching semantic or Cargo criteria.
  • Link helpers: #formlink, #formredlink and #autoedit generate links that open a form for a target page (including red‑link creation).

Defining forms

Forms are written in a simple markup language inside a page in the Form: namespace. The most common tags are:

  • {{{field|name=Title|label=Page title|type=text}}}
  • {{{section|name=Details}}} – groups fields into collapsible sections.
  • {{{for template=MyTemplate}}} … {{|end template}} – tells PageForms which template(s) to populate.

Tabs, tooltips and default values can be added with the tab= and default= parameters.

Input types

PageForms supports a wide range of field types, for example:

  • text, textarea, date, datetime, year, time picker
  • dropdown, radiobutton, checkboxes, listbox, combobox (autocomplete)
  • tokens (free‑form tags), rating, googlemaps, leaflet, openlayers
  • file upload (with #forminput helper)

Each type can be linked to a Semantic MediaWiki or Cargo data type, enabling validation and autocompletion.

Autocompletion, defaults and mappings

When a property is defined in SMW/Cargo, PageForms can pull existing values for a field. Options such as autocomplete=on, values= (static list) or mapping= (display name ↔ stored value) make data entry fast and consistent.

Special pages that come with PageForms

  • Special:CreateForm – wizard to generate a new form.
  • Special:CreateTemplate and Special:CreateClass – helpers that also generate the associated form, template and category.
  • Special:MultiPageEdit – spreadsheet‑style bulk editing of many pages that use the same template.
  • Special:Templates – list of all templates on the wiki.

Template helpers

PageForms adds four parser functions that simplify template design:

  • #template_params – declares expected parameters, labels, display rules and SMW/Cargo field links.
  • #template_display – renders a template in infobox, table, sections or text format.
  • #arraymap – maps a delimiter‑separated list to a pattern (e.g. turning "A,B" into [[A]], [[B]]).
  • #arraymaptemplate – like #arraymap but uses a separate template for the mapping.

These functions work both inside and outside forms, reducing repetitive wikitext.

Permissions and configuration tips

Typical rights you may want to adjust in LocalSettings.php:

  • $wgGroupPermissions['*']['viewedittab'] = false; – hide the form edit tab for anonymous users.
  • $wgGroupPermissions['sysop']['editrestrictedfields'] = true; – allow admins to edit fields marked restricted.
  • $wgGroupPermissions['user']['multipageedit'] = true; – let regular users use the bulk‑edit spreadsheet.

Most other behaviour is controlled by the $wgPageForms* variables documented on the extension page.

What you can achieve

With PageForms you can build a fully‑structured wiki without asking contributors to learn wikitext. Typical use‑cases include:

  • Catalogues (books, movies, equipment) with searchable query forms.
  • Event calendars where the date‑picker field writes to a Semantic MediaWiki property.
  • Bulk data entry for scientific datasets via Special:MultiPageEdit.
  • User‑friendly page creation from the sidebar using red‑link forms.
  • Dynamic infoboxes that automatically keep the display in sync with the underlying template.

All of these can be set up by wiki editors themselves, without any PHP coding.

Subscribe to MediaWiki Tips and Tricks

Don’t miss out on the latest articles. Sign up now to get access to the library of members-only articles.
jamie@example.com
Subscribe