Difference between revisions of "User talk:B.Tay"
From MHWiki
m (Typo) |
m |
||
| Line 35: | Line 35: | ||
</tr> | </tr> | ||
</table> | </table> | ||
| + | </pre> | ||
| + | |||
| + | Some sample coding #2 | ||
| + | |||
| + | <pre> | ||
| + | <!-- Automated stuff: the code --> | ||
| + | {{if|{{NAMESPACE}} <!-- The template checks what the namespace of the page is --> | ||
| + | | <!-- Since the automation should only be done on the main namespace, if the namespace has text, nothing is done --> | ||
| + | | <!-- Here, the namespace has been confirmed as the main one, hence the following 4 things... --> | ||
| + | <!-- 1) Auto-categorisation for Mouse Groups --> | ||
| + | {{if|{{{mgroup|}}} <!-- Categoriser looks for "mgroup" parameter if it doesn't exist then default value is no text --> | ||
| + | |[[Category:Mice]] [[Category:{{{mgroup}}}]] <!-- If there is text in the "mgroup" parameter, then "mice" and "mgroup" category tags --> | ||
| + | {{if|{{{subgroup|}}} <!-- Categoriser also looks for "subgroup" parameter if "mgroup" has text --> | ||
| + | |[[Category:{{{mgroup}}} ({{{subgroup}}})]] <!-- If there is text in the "subgroup" parameter, then "mgroup (subgroup)" category tag) --> | ||
| + | | <!-- If there is no text in the "subgroup" parameter, then nothing more is done --> | ||
| + | }} | ||
| + | | <!-- If there is no text in the "mgroup" parameter, nothing is done --> | ||
| + | }} | ||
| + | <!-- 2) Auto-tracker for the "Missing Image" category: iTunes Mouse exclusion included in 3RD LEVEL --> | ||
| + | {{if|{{{image|}}} <!-- 1ST LEVEL: The tracker looks for the "image" parameter, if it doesn't exist then the default value is no text --> | ||
| + | | <!-- 1ST LEVEL: If there is text in the "image" parameter, then proceed to 2ND LEVEL --> | ||
| + | {{ifeq|{{MHdomain}} <!-- 2nd LEVEL: The tracker now looks for two things, first, the {{MHdomain}} template --> | ||
| + | |{{padleft:|29|{{{image|}}}}} <!-- 2nd LEVEL: Second, the first 29 characters from the "image" parameter --> | ||
| + | | <!-- 2nd LEVEL: If {{MHdomain}} and 29 characters are the same, then nothing is done --> | ||
| + | | <!-- 2nd LEVEL: If {{MHdomain}} and 29 characters are different, then proceed to 3RD LEVEL --> | ||
| + | {{ifeq|https://i.imgur.com/Km26rS2.jpg <!-- 3rd LEVEL: The tracker now looks for two things, first, the iTunes Mouse image link --> | ||
| + | |{{padleft:|31|{{{image|}}}}} <!-- 3rd LEVEL: Second, the first 31 characters from the "image" parameter --> | ||
| + | | <!-- 3rd LEVEL: If image link and 31 characters are the same, then nothing is done --> | ||
| + | |[[Category:Missing Image]] <!-- 3rd LEVEL: If image link and 31 characters are different, "Missing Image" category tag --> | ||
| + | }} | ||
| + | }} | ||
| + | |[[Category:Missing Image]] <!-- 1ST LEVEL: If there is no text in the "id" parameter, the page is tagged with the "Missing ID" category --> | ||
| + | }} | ||
| + | <!-- 3) Auto-tracker for the "Missing ID" category --> | ||
| + | {{if|{{{id|}}} <!-- The tracker looks for the "id" parameter, if it doesn't exist then the default value is no text --> | ||
| + | | <!-- If there is text in the "id" parameter, nothing is done --> | ||
| + | |[[Category:Missing ID]] <!-- If there is no text in the "id" parameter, "Missing ID" category tag --> | ||
| + | }} | ||
| + | <!-- 4) Automatically remove TOC from Mouse pages --> | ||
| + | __NOTOC__ | ||
| + | }} | ||
</pre> | </pre> | ||
Revision as of 19:15, 23 July 2021
Some sample coding
<table style="text-align: center; border-collapse: collapse" class="mw-collapsible sortable mw-collapsed"> <caption style="text-align: left; white-space: nowrap"> <!--Caption--> </caption> <tr> <th style="border: 1px solid; padding: 5px; background-color: #eeeeee; text-align: left"> <!--Header--> Item</td> <th style="border: 1px solid; padding: 5px; background-color: #eeeeee" class="unsortable"> <!--Header--> Valour Rift Treasure Chest<br/>Amount</td> <th style="border: 1px solid; padding: 5px; background-color: #eeeeee" class="unsortable"> <!--Header--> Rare Valour Rift Treasure Chest<br/>Amount</td> </tr> <tr> <td style="border: 1px solid; padding: 5px; text-align: left"> <!--Item--> [[Gold]]</td> <td style="border: 1px solid; padding: 5px"> <!--Common--> 32,000</td> <td style="border: 1px solid; padding: 5px"> <!--Rare--> 64,000</td> </tr> <tr> <td style="border: 1px solid; padding: 5px; text-align: left"> <!--Item--> [[Points]]</td> <td style="border: 1px solid; padding: 5px"> <!--Common--> 25,000</td> <td style="border: 1px solid; padding: 5px"> <!--Rare--> 50,000</td> </tr> <tr> <td style="border: 1px solid; padding: 5px; text-align: left"> <!--Item--> [[Ancient Charm]]s</td> <td style="border: 1px solid; padding: 5px"> <!--Common--> 10</td> <td style="border: 1px solid; padding: 5px"> <!--Rare--> 20</td> </tr> <tr> <td style="border: 1px solid; padding: 5px; text-align: left"> <!--Item--> [[Gauntlet Elixir]]</td> <td style="border: 1px solid; padding: 5px"> <!--Common--> 10</td> <td style="border: 1px solid; padding: 5px"> <!--Rare--> 50</td> </tr> <tr> <td style="border: 1px solid; padding: 5px; text-align: left"> <!--Item--> [[Unstable Celestial Timechest]]</td> <td style="border: 1px solid; padding: 5px"> <!--Common--> 1</td> <td style="border: 1px solid; padding: 5px"> <!--Rare--> 2</td> </tr> </table>
Some sample coding #2
<!-- Automated stuff: the code -->
{{if|{{NAMESPACE}} <!-- The template checks what the namespace of the page is -->
| <!-- Since the automation should only be done on the main namespace, if the namespace has text, nothing is done -->
| <!-- Here, the namespace has been confirmed as the main one, hence the following 4 things... -->
<!-- 1) Auto-categorisation for Mouse Groups -->
{{if|{{{mgroup|}}} <!-- Categoriser looks for "mgroup" parameter if it doesn't exist then default value is no text -->
|[[Category:Mice]] [[Category:{{{mgroup}}}]] <!-- If there is text in the "mgroup" parameter, then "mice" and "mgroup" category tags -->
{{if|{{{subgroup|}}} <!-- Categoriser also looks for "subgroup" parameter if "mgroup" has text -->
|[[Category:{{{mgroup}}} ({{{subgroup}}})]] <!-- If there is text in the "subgroup" parameter, then "mgroup (subgroup)" category tag) -->
| <!-- If there is no text in the "subgroup" parameter, then nothing more is done -->
}}
| <!-- If there is no text in the "mgroup" parameter, nothing is done -->
}}
<!-- 2) Auto-tracker for the "Missing Image" category: iTunes Mouse exclusion included in 3RD LEVEL -->
{{if|{{{image|}}} <!-- 1ST LEVEL: The tracker looks for the "image" parameter, if it doesn't exist then the default value is no text -->
| <!-- 1ST LEVEL: If there is text in the "image" parameter, then proceed to 2ND LEVEL -->
{{ifeq|{{MHdomain}} <!-- 2nd LEVEL: The tracker now looks for two things, first, the {{MHdomain}} template -->
|{{padleft:|29|{{{image|}}}}} <!-- 2nd LEVEL: Second, the first 29 characters from the "image" parameter -->
| <!-- 2nd LEVEL: If {{MHdomain}} and 29 characters are the same, then nothing is done -->
| <!-- 2nd LEVEL: If {{MHdomain}} and 29 characters are different, then proceed to 3RD LEVEL -->
{{ifeq|https://i.imgur.com/Km26rS2.jpg <!-- 3rd LEVEL: The tracker now looks for two things, first, the iTunes Mouse image link -->
|{{padleft:|31|{{{image|}}}}} <!-- 3rd LEVEL: Second, the first 31 characters from the "image" parameter -->
| <!-- 3rd LEVEL: If image link and 31 characters are the same, then nothing is done -->
|[[Category:Missing Image]] <!-- 3rd LEVEL: If image link and 31 characters are different, "Missing Image" category tag -->
}}
}}
|[[Category:Missing Image]] <!-- 1ST LEVEL: If there is no text in the "id" parameter, the page is tagged with the "Missing ID" category -->
}}
<!-- 3) Auto-tracker for the "Missing ID" category -->
{{if|{{{id|}}} <!-- The tracker looks for the "id" parameter, if it doesn't exist then the default value is no text -->
| <!-- If there is text in the "id" parameter, nothing is done -->
|[[Category:Missing ID]] <!-- If there is no text in the "id" parameter, "Missing ID" category tag -->
}}
<!-- 4) Automatically remove TOC from Mouse pages -->
__NOTOC__
}}