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) | 12 |
| MW: {{CURRENTMONTHNAME}} (name) | December | |
| MW: {{CURRENTMONTHNAMEGEN}} (genitive form) | December | |
| MW: {{CURRENTMONTHABBREV}} (abbreviation; requires MW 1.5+) | Dec | |
| Day-of-month | MW: {{CURRENTDAY}} (unpadded number) | 10 |
| MW: {{CURRENTDAY2}} (zero-padded number; requires MW 1.6+) | 10 | |
| Day-of-week | MW: {{CURRENTDOW}} (unpadded number) | 3 |
| MW: {{CURRENTDAYNAME}} (name) | Wednesday | |
| Week | MW: {{CURRENTWEEK}} (number) | 50 |
| Time: full | MW: {{CURRENTTIME}} (24-hour HH:mm format) | 04:17 |
| Time: hour | MW: {{CURRENTHOUR}} (24-hour zero-padded number) | 04 |
| Timestamp | MW: {{CURRENTTIMESTAMP}} | 20251210041741 |
| 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