MediaWiki Tips

From MediaWiki-1.39
Jump to navigation Jump to search

MediaWiki Tips

This page collects useful formatting techniques, admin tricks, and style conventions used across the Sh1re Commons and related wikis (e.g. Eckfordc). Contributions welcome.

Naming, Linking, and Underscores

MediaWiki converts spaces to underscores (`MediaWiki_Tips` → `MediaWiki Tips`).

You can also use internal links like this:

[[MediaWiki Tips]]

If the page doesn’t exist, it shows up as a red link — clicking it lets you create the page directly.


Overview

Templates are wiki pages whose content can be embedded in other pages. They allow for easy translations and help maintain consistency among related documents. This page describes some templates for formatting text.

Also see Help:Templates.

Template:TOC

Templates

Template Example syntax Example output
Hatnote
{{hatnote|Here is my note.}}

Here is my note.


Format like so:
{{{Hatnote|content is content}}}


Caution
{{Caution}} Here is my caution 1.
{{Caution|Here is my caution 2.}}
Template:Caution Here is my caution 1.

Template:Caution
Warning
{{warning}} Here is my warning 1.
{{warning|Here is my warning 2.}}
⚠️

Warning: {{{1}}}





Here is my warning 1.

⚠️

Warning: Here is my warning 2.





Todo
{{Todo|Here is my todo.}}
Template:Todo
Fixtext
{{Fixtext|Here is my fixtext.}}
Template:Fixtext
Note
{{note|Note 1}}
{{note|Note 2|reminder}}
{{note|Note 3|error}}
{{note}} Loose test 

Note: Note 1


Note: Note 2


Note: Note 3


Note: {{{1}}}

Loose test
Tip
{{Tip|Here is my tip.}}
💡
   Tip: Here is my tip.





Notice
{{Notice|Here is my notice.}}
   Upcoming Event: Annual Community Meetup 
Scheduled for: TBA at Main Hall

Join us for our yearly gathering to discuss upcoming wiki projects and milestones!

Main
{{Main|test|sandbox|w:foo}}
Template:Main
See also
{{See also|test|sandbox|w:foo}}
Template:See also
Merge
{{{{merge|Example_page}}
Template:Merge
Talkquote
{{talkquote|foo bar bang|example}}
Template:Talkquote
Smaller
Body text {{Smaller|(note with smaller text)}}
Body text Template:Smaller
Status
{{status}}
{{status|done}}
{{status|on hold}}
{{status|not done}}
Template:Status


Template:Status


Template:Status


Template:Status
Doing
{{Doing}}
Template:Doing
Not done
{{Not done}}
Template:Not done
Done
{{Done}}
Template:Done
Resolved
{{Resolved}}
Template:Resolved
Documentation needed
{{Documentation needed}}
{{Documentation needed|section}}
Template:Documentation needed

Template:Documentation needed

Fixme
{{Fixme}}
Template:Fixme
Historical
{{Historical}}
Template:Historical
Outdated (Alias: Update)
{{Outdated}}
Alias: {{Update}}
Template:Outdated
HistoricalProject
{{HistoricalProject}}
Template:HistoricalProject
Archived extension
{{Archived extension}}
Template:Archived extension
Soft redirect
{{Soft redirect}}
Template:Soft redirect
Draft
{{Draft}}
Template:Draft
DoNotTranslate
{{DoNotTranslate}}
Template:DoNotTranslate
Last updated
{{Last updated}}
Template:Last updated
Doc-links
{{Doc-links|Link to an example doc}}
{{Doc-links|Link to a doc template|template}}
Template:Doc-links

Template:Doc-links

TabbedWindow
{{TabbedWindowBegin}}
...
{{TabbedWindowEnd}}

Template:TabbedWindowBegin

Python

<syntaxhighlight lang="Python" line='line'> code </syntaxhighlight>

JavaScript

<syntaxhighlight lang="javascript" line='line'> code </syntaxhighlight> Template:TabbedWindowEnd

Zero-JS Enhancements

This wiki stack is hardened for legacy environments — no JavaScript required. Where others use JS libraries, we prefer:

  • **Pure HTML/CSS** navigation boxes and style blocks
  • **Table of contents** via headings (e.g. `== Section ==`)
  • **No collapsibles or toggles** (unless emulated with `<details>` in supported browsers)
  • Minimal inline CSS for color blocks, tooltips, and alerts

Recommended Conventions

  • Use `` for inline paths and scripts: php maintenance/update.php
  • Use `
    ` or `<syntaxhighlight lang="bash">` for CLI blocks

* All admin helper pages should be tagged like this: <pre> [[Category:Documentation]]

See also