MediaWiki Syntax

From CoinHuntWorldWiki
Jump to navigation Jump to search

This is the collection of MediaWiki info that the wiki contributors have collected and used throughout the CHW Wiki. Special thanks to khag, iSpeakNerd, and anakura for figuring out different parts of MediaWiki for everyone.

Naming Conventions

File names for images should be <GeneralType>-<SpecificType>.png e.g.: Canada-Ontario-Toronto

We already have some file names that don't follow this rule. Please continue to use the naming rules below for Cubies, Keys and Player Avatars:

  • Cubie: CubieBlue.png
  • Key: KeyGreen.png
  • Player Avatar: PlayerAvatar_Playername.png
  • Yellow Vault Question: Yellow-Vault-Name-First-Question.png

Page Headers

  • Pages should have a short summary of the page at the top, then use MediaWiki Header tags for sections starting with H2 e.g. ==H2 Header==
  • Avoid H1 header use - search engines will use H1 headers as page name instead of page name

Basic Text Formatting

Main MediaWiki Documentation https://www.mediawiki.org/wiki/MediaWiki

Links

Internal Links

[[Internal page | display text]]
Subsection Links
[[Page Name#Subsection_name | display text]]

External Links

[http://www.ExternalLink.com display text]

Images + Media

[[File:CubieVampire.png |300px|thumb|none|Vampire Cubie.]]

Gifs

  • Use "frame" not "thumb" for Gifs
[[File:VampireAnimation.gif |300px|frame|none|Vampire Animation.]]

YouTube Video

Embedding a single video (get the video ID from the URL):

<youtube width="400" height="240">xUjNcVyPYuo</youtube>

Embedding a playlist:

{{YouTubePlaylist|UU02wFKBpF7Xg7qVZi8VwLDw}}

Note: On player pages, if you want to show a player's YouTube channel, you can embed their entire upload history (newest showing first) by using their youtube channel name or ID # from their URL.

Twitch Video

Embedding a Twitch VOD:

<embedvideo dimensions=400 service=twitchvod>1170561473</embedvideo>

(get the video ID from the URL: https://www.twitch.tv/videos/1170561473)

Embedding a Twitch Stream:

<embedvideo dimensions=400 service="twitch">raynstorm83</embedvideo>

(get the username from the URL https://www.twitch.tv/raynstorm83)

Text Formatting

MediaWiki Markup

''italic''
'''bold'''
'''''bold & italic'''''

HTML

Comments
<!--This is a comment-->

Embeddable Content and Templates

Progress Bars

Here is an example of how to use progress bars:

<table style="width: 100%; max-width: 500px; padding: 10px; box-sizing: border-box;">
<tr><td style="width: 30px; zoom: 1.2;">{{Resin|icononly}}         </td><td>{{ProgressBar|100| 100|k|30px}}</td></tr>
<tr><td style="width: 30px; zoom: 1.2;">{{Beach Cocktail|icononly}}</td><td>{{ProgressBar| 37| 100| |30px}}</td></tr>
<tr><td style="width: 30px; zoom: 1.2;">{{Dragon Scales|icononly}} </td><td>{{ProgressBar| 50|1000| |30px}}</td></tr>
<tr><td style="width: 30px; zoom: 1.2;">{{Red Ribbons|icononly}}   </td><td>{{ProgressBar|  0|1000| |30px}}</td></tr>
</table>
Resin 100 k / 100 k
Beach Cocktail 37 / 100
Dragon Scales 50 / 1000
Red Ribbons 0 / 1000

Player Avatar

Add following text to the top of the player page:

{{PlayerAvatar}}

Save and then click on the link it creates on the page and upload the players avatar image. Please use the naming format: "PlayerAvatar_Playername.png"

Embeds

Embedding One Page into another page

You can embed a section or an entire page into another page for convenience. For example if you were writing a page about Ethereum and wanted to include information about Gwei you could embed the entire Gwei page inside the Ethereum page with this tag:

{{:Gwei}}

Note the colon before the page title is important, it tells the parser to embed the PAGE called Gwei not the Template called Gwei (if one existed).

Embedding One Page Section into another page

We have an extension enabled to allow embedding of specific sections. If you wanted to embed not an entire page but just a particular section, you can do so by defining both the page name and the section name. If you were writing a page about Canada Day Event and you wanted to pull some information from the Canada Cubie page, you could do so like this:

{{#lsth:pagename|sectionX}}
{{#lsth: Canada Cubie | First printed Canada Cubie }}

For further documentation of the Labeled Section Transclusion extension, see here: extension link

Embedding a Spreadsheet

Before you can embed a google document or spreadsheet, the owner of the file must "Publish to the web" by clicking "File" then near the bottom of the file menu clicking "Publish to the web" and then in the popup box clicking the blue "Publish" button.

Use <googlespreadsheet> html tag as shown below to embed a doc in the wiki:

<googlespreadsheet width="500" height="300" style="width: 100%"> Google_Doc_key_goes_here </googlespreadsheet>

Google_Doc_key is the text string in the share link see example embed at the UV Route Planning Tool

More details at the extension page: https://www.mediawiki.org/wiki/Extension:GoogleDocs4MW

Embedding a Google Document or a Google Spreadsheet

Before you can embed a google document or spreadsheet, the owner of the file must "Publish to the web" by clicking "File" then near the bottom of the file menu clicking "Publish to the web" and then in the popup box clicking the blue "Publish" button.

Use {{GoogleDoc}} template tag as shown below to embed either a google sheet or a google doc in the wiki:

{{GoogleDoc | doc   | theReallyLongGoogleDocIdGoesHere }}
{{GoogleDoc | sheet | theReallyLongGoogleDocIdGoesHere }}

Or if you want to include custom height and width, in pixels (but don't include "px"):

{{GoogleDoc | sheet | theReallyLongGoogleDocIdGoesHere | 800px | 800px }}

Country Shortcodes

Shortcodes for countries will be prefixed with the word "Country" and then the 2 character country code:


{{Country US}} gives USA

{{Country CA}} gives Canada

{{Country UK}} gives UK

{{Country SV}} gives El Salvador

Shortcodes

Some pages on this wiki have "shortcode" templates which provide a link to a page as well as an icon that represents the page. For example, players with custom avatars, cubies, resources, etc all have shortcode templates. Instead of linking to the page directly, you will link to the shortcode. Here is an example:

[[Cubiecrane]] shows as Cubiecrane

{{Cubiecrane}} shows as Cubiecrane

If you wanted to display just the icon for some reason without the text, you can use {{Cubiecrane|icononly}} which displays Cubiecrane

And if you don't know if a shortcode exists but want to try to use one just in case it does, you can do {{ifTE|Cubiecrane}} which will try to use a shortcode but will fall back to a regular link if no shortcode exists.

Leaderboard Data

Creating a Podium Graphic

Podium graphics can be created using the {{LBPodium}} template. We add a new graphic each month to the Leaderboard Results page. The tag takes 15 parameters. The first 3 parameters are for the first place finisher, the next 3 parameters are for the second place finisher, and so on, for the top 5 finishers. Below is an example.

{{LBPodium
  |Jrnightingale | CA | Fire Elemental Cubie
  |BlocBoi       | US | Fire Elemental Cubie
  |Khag          | US | Green Cubie
  |Trugoy        | US | Fire Dragon Cubie
  |Lionlocks     | CA | Doge Cubie
}}

Embedding a Podium Graphic

Podium graphics are stored on the Leaderboard Results page as an individual section (one podium graphic per section). You can embed that section elsewhere using the lsth tag, then page name, then section name:

{{#lsth: Leaderboard Results | Top 5 Global September 2021 }}


Linking to LB Results

Below are two examples of linking to LB results using the {{LBLink}} template. You need to provide Year, Month, LB Type, and LB Name.

{{LBLink|2021|9|Country|USA}}: USA Country Leaderboard Results September 2021

{{LBLink|2021|9|Global|Global}}: Global Leaderboard Results September 2021

Or if you want to send a link to someone outside of mediawiki, you can use the link format below which uses the same parameters as the above template tag:

https://coinhuntworldwiki.com/index.php?title=Leaderboard_Results&year=2021&month=9&lbtype=Country&lbname=USA

Embedding LB Results

If you wish to display a LB table you can do so using template tags. You can display player-specific leaderboard results, or you can display a monthly LB table.

Below is an example of showing a single players all time results using the {{LBPlayerAchievementTable}} template.

This will be the most useful of all these templates, as you can just put {{LBPlayerAchievementTable}} on every player's page and it will automatically show all their LB results (no need to provide player name if the page using the template is a player's page).

{{LBPlayerAchievementTable|BlocBoi}}:

Month Type Region LB Link Place Prize
1 November 2021 Country Leaderboard USA πŸ”Ž 7th 1 Yellow Key
1 November 2021 Global Leaderboard Global πŸ”Ž 12th
1 October 2021 Country Leaderboard UK πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 October 2021 Country Leaderboard USA πŸ”Ž πŸ₯‰3rd 4 Yellow Prize Box
1 October 2021 Global Leaderboard Global πŸ”Ž πŸ₯‡1st 5 Red Key
1 September 2021 Country Leaderboard USA πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 September 2021 Global Leaderboard Global πŸ”Ž πŸ₯ˆ2nd 4 Red Key
1 August 2021 Country Leaderboard USA πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 August 2021 Global Leaderboard Global πŸ”Ž πŸ₯ˆ2nd 4 Red Key
1 July 2021 Country Leaderboard USA πŸ”Ž πŸ₯‰3rd 4 Yellow Prize Box
1 July 2021 Global Leaderboard Global πŸ”Ž πŸ₯‰3rd 3 Red Key
1 June 2021 Country Leaderboard USA πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 June 2021 Global Leaderboard Global πŸ”Ž 5th 1 Red Key
1 May 2021 Country Leaderboard USA πŸ”Ž πŸ₯ˆ2nd 5 Yellow Prize Box
1 May 2021 Global Leaderboard Global πŸ”Ž πŸ₯ˆ2nd 4 Red Key
1 April 2021 Country Leaderboard USA πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 April 2021 Global Leaderboard Global πŸ”Ž πŸ₯‰3rd 3 Red Key
1 March 2021 Country Leaderboard USA πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 March 2021 Global Leaderboard Global πŸ”Ž πŸ₯‡1st 5 Red Key
1 February 2021 Country Leaderboard USA πŸ”Ž 6th 1 Yellow Prize Box
1 January 2021 Global Leaderboard Global πŸ”Ž 4th 3 Yellow Prize Box
1 December 2020 Global Leaderboard Global πŸ”Ž πŸ₯‡1st 1 Red Prize Box
1 November 2020 Global Leaderboard Global πŸ”Ž πŸ₯ˆ2nd 5 Yellow Prize Box

Below is an example of displaying a set of leaderboard results for a specific region in a specific month using the {{LBMonthlyAchievementTable}} template.

The table below shows Canada's country LB from June 2021

{{LBMonthlyAchievementTable|2021|06|Country|Canada}}

Place Player Prize
πŸ₯‡1st Xrphilip 1 Red Prize Box
πŸ₯ˆ2nd SMOOSHIE 5 Yellow Prize Box
πŸ₯‰3rd Geeya 4 Yellow Prize Box
4th Bearclaw 3 Yellow Prize Box
5th Minel 2 Yellow Prize Box
6th Mtougy 1 Yellow Prize Box
7th Jtcrypto 1 Yellow Prize Box
8th Magnus 1 Yellow Prize Box
9th Brend 1 Yellow Prize Box
10th Chomyn 1 Yellow Prize Box
11th IchigoKIl 4 Green Prize Box
12th Proxied 4 Green Prize Box
13th Katla 4 Green Prize Box
14th VanL 4 Green Prize Box
15th Mdotcom 4 Green Prize Box
16th Nici 4 Green Prize Box
17th Cheria 4 Green Prize Box
18th Wheretogo 4 Green Prize Box
19th MikeFaulksy 4 Green Prize Box
20th nnmari 4 Green Prize Box
21st Thealbino 3 Green Prize Box
22nd Xrpian 3 Green Prize Box
23rd Jrnightingale 3 Green Prize Box
24th Sicachu 3 Green Prize Box
25th Cryptocrytter 3 Green Prize Box
26th Kathyd 3 Green Prize Box
27th Yauza 3 Green Prize Box
28th westbeachmusic 3 Green Prize Box
29th Broximo 3 Green Prize Box
30th kooshy 3 Green Prize Box
31st coindance 2 Green Prize Box
32nd Kacarrot 2 Green Prize Box
33rd Kevostrings 2 Green Prize Box
34th KingThermos 2 Green Prize Box
35th Ventune 2 Green Prize Box
36th D0naldDuck 2 Green Prize Box
37th Gryptogrma 2 Green Prize Box
38th Vixvl 2 Green Prize Box
39th BalzacBrenda 2 Green Prize Box
40th Kentsuji 2 Green Prize Box
41st BPOD 1 Green Prize Box
42nd ForaJuveCrypto 1 Green Prize Box
43rd Squeamy 1 Green Prize Box
44th Mongo 1 Green Prize Box
45th Morestagedives 1 Green Prize Box
46th Abs123 1 Green Prize Box
47th Hoggie 1 Green Prize Box
48th Zergleek 1 Green Prize Box
49th Hbharrison 1 Green Prize Box
50th Jka92 1 Green Prize Box

Other Functions

Medal Icon

If you wish to display a "medal" emoji (πŸ₯‡πŸ₯ˆπŸ₯‰) next to a number, you can use the template {{Medal|number}} and change number to the correct number (1 for gold, 2 for silver, 3 for bronze). If you provide a number other than 1, 2, or 3, nothing displays for this template. This is useful in other templates (like leaderboard tables) to add a medal icon next to the place name.

Numerical Ordinals

If you want to change "1" to "1st" or "95" to "95th" you can use the {{Ordinal|number}} template.

For example, {{Ordinal|5}} becomes 5th

Month Names

If you want to change a month number to a month name, for example "3" becomes "March" you can use the template {{MonthName|monthnumber}}

For example, {{MonthName|3}} becomes March