MediaWiki/content programming
Jump to navigation
Jump to search
Overview
MediaWiki's built-in features already allow some simple dynamic text management and manipulation; with the addition of various extensions, much more sophisticated tasks can be accomplished, making MediaWiki into a sort of "swiss army knife" content manager application.
Information
How to get various bits of information about stuff
Date/Time | ||
Year | MW: {{CURRENTYEAR}} | 2025 |
Month | MW: {{CURRENTMONTH}} (zero-padded number) | 05 |
MW: {{CURRENTMONTHNAME}} (name) | May | |
MW: {{CURRENTMONTHNAMEGEN}} (genitive form) | May | |
MW: {{CURRENTMONTHABBREV}} (abbreviation; requires MW 1.5+) | May | |
Day-of-month | MW: {{CURRENTDAY}} (unpadded number) | 22 |
MW: {{CURRENTDAY2}} (zero-padded number; requires MW 1.6+) | 22 | |
Day-of-week | MW: {{CURRENTDOW}} (unpadded number) | 4 |
MW: {{CURRENTDAYNAME}} (name) | Thursday | |
Week | MW: {{CURRENTWEEK}} (number) | 21 |
Time: full | MW: {{CURRENTTIME}} (24-hour HH:mm format) | 10:06 |
Time: hour | MW: {{CURRENTHOUR}} (24-hour zero-padded number) | 10 |
Timestamp | MW: {{CURRENTTIMESTAMP}} | 20250522100611 |
Page Title | ||
Prefix (namespace only) |
DPL: %NAMESPACE% | |
Suffix (without namespace) |
DPL: %TITLE% | |
Page Stats | ||
Usage counter (hits) | DPL: %COUNT% (requires addpagecounter=true)
DPL: %COUNTFS% = a font size number based on usage counter | |
Page size (bytes) | DPL: %SIZE% (requires addpagesize=true)
DPL: %SIZEFS% – font size number based on article size | |
Creation date | DPL: %DATE% (requires addeditdate=true and ordermethod=firstedit) | |
Last edit date | DPL: %DATE% (requires addeditdate=true and ordermethod=lastedit) | |
Page creator | DPL: %USER% (requires adduser=true and ordermethod=firstedit) | |
Page last editor | DPL: %USER% (requires adduser=true and ordermethod=lastedit) |
Sources
- MW (built-in): Help:Magic words
- DPL: DPL Manual