Code snippets: Difference between revisions

From LOTR-TCG Wiki
imported>Teltura
(Created page with "=====Code Snippets===== This page exists as a reference for quick code that can be copy-pasted into wiki pages easily. \\ ---- \\ Pasted as the first line in an article, mak...")
 
imported>IstariBot
(IstariBot mass importing articles from the old DokuWiki instance.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=====Code Snippets=====
=Code Snippets=


This page exists as a reference for quick code that can be copy-pasted into wiki pages easily.
This page exists as a reference for quick code that can be copy-pasted into wiki pages easily.
\\
 
----
----
\\


Pasted as the first line in an article, makes a nice disambiguation line
Pasted as the first line in an article, makes a nice disambiguation line


<div>
^  ''%%<div centeralign><wrap help>If you meant the keyword unique to Nazgul, see [[Twilight]]%%''  ^
^  ''%%<div centeralign><wrap help>If you meant the keyword unique to Nazgul, see [[Twilight]]</wrap></div>%%''  ^
</div>


\\
Inserts a card image at about 30% normal zoom that doubles as a link to the card when clicked.


Inserts a card image at about 30% normal zoom that doubles as a link to the card when clicked.
<div>
^  ''%%[[lotr01001|{{  cards:lotr01001.jpg?200  |The One Ring, Isildur's Bane}}]]%%''  ^
^  ''%%[[lotr01001|{{  cards:lotr01001.jpg?200  |The One Ring, Isildur's Bane}}]]%%''  ^
</div>


\\
Inserts a link to a card's wiki page.  Usually the autolinker works, but occasionally it doesn't, and sometimes you want to avoid typing in the whole name regardless.


Inserts a link to a card's wiki page.  Usually the autolinker works, but occasionally it doesn't, and sometimes you want to avoid typing in the whole name regardless.
^  ''%%[[lotr01001|The One Ring, Isildur's Bane]]%%''  ^
<div>
^  ''%%[[:lotr01001|The One Ring, Isildur's Bane]]%%''  ^
</div>


\\
Used as a direct quote from the Comprehensive Rules.  Insert in a section after an explanation of the mechanics is given, to give the article an air of legitimacy.
Used as a direct quote from the Comprehensive Rules.  Insert in a section after an explanation of the mechanics is given, to give the article an air of legitimacy.
<div>
 
^  ''%%<div info>**From the [[comprehensive_rules_4-0#relevant_section|Comprehensive Rules 4.0]]:**%%''  ^
^  ''%%[[Category: Comprehensive Rules References That Need Fixed]]'''From the [[comprehensive_rules_4-0#relevant_section|Comprehensive Rules 4.0]]:'''%%''  ^
^  ''%%If such-and-such is true, then the game is won. %%''  ^
^  ''%%If such-and-such is true, then the game is won. %%''  ^
^  ''%%//See also [[comprehensive_rules_4-0#another_relevant_section|Another Relevant Section entry in the Comprehensive Guide]].//</div>%%''  ^
^  ''%%''See also [[comprehensive_rules_4-0#another_relevant_section|Another Relevant Section entry in the Comprehensive Guide]].''%%''  ^
</div>


\\
Redirect (automatically navigates to the redirect_page if the user tries to access it):


Redirect (automatically navigates to the redirect_page if the user tries to access it):
^  ''<nowiki>#REDIRECT [[redirect_page]]</nowiki>''  ^
<div>
^  ''<nowiki>~~REDIRECT>redirect_page~~</nowiki>''  ^
</div>
\\


To access pages that have a redirect on them, append the following to the end of the URL:
To access pages that have a redirect on them, append the following to the end of the URL:
<div>
 
^  ''?redirect=no''  ^
^  ''?redirect=====no''  ^
</div>
\\


Copies page_to_reference into the current one:
Copies page_to_reference into the current one:
<div>
 
^  ''<nowiki>{{page>:page_to_reference}}</nowiki>''  ^
^  ''<nowiki>{{:page_to_reference}}</nowiki>''  ^
</div>
\\


Additionally, here are all the table pages that can be referenced:
Additionally, here are all the table pages that can be referenced:


<div>
^  ''<nowiki>{{:play_area_table}}</nowiki>''  ^  ''<nowiki>{{:card_layout_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:play_area_table}}</nowiki>''  ^  ''<nowiki>{{page>:card_layout_table}}</nowiki>''  ^^
^  ''<nowiki>{{:card_action_table}}</nowiki>''  ^  ''<nowiki>{{:game_setup_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:card_action_table}}</nowiki>''  ^  ''<nowiki>{{page>:game_setup_table}}</nowiki>''  ^^
^  ''<nowiki>{{:culture_table}}</nowiki>''  ^  ''<nowiki>{{:card_type_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:culture_table}}</nowiki>''  ^  ''<nowiki>{{page>:card_type_table}}</nowiki>''  ^^
^  ''<nowiki>{{:turn_order_table}}</nowiki>''  ^  ''<nowiki>{{:keyword_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:turn_order_table}}</nowiki>''  ^  ''<nowiki>{{page>:keyword_table}}</nowiki>''  ^^
^  ''<nowiki>{{:loaded_keyword_table}}</nowiki>''  ^  ''<nowiki>{{:unloaded_keyword_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:loaded_keyword_table}}</nowiki>''  ^  ''<nowiki>{{page>:unloaded_keyword_table}}</nowiki>''  ^^
^  ''<nowiki>{{:electronic_platform_table}}</nowiki>''  ^  ''<nowiki>{{:set_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:electronic_platform_table}}</nowiki>''  ^  ''<nowiki>{{page>:set_table}}</nowiki>''  ^^
^  ''<nowiki>{{:format_table}}</nowiki>''  ^  ''<nowiki>{{:action_table}}</nowiki>''  ^^
^  ''<nowiki>{{page>:format_table}}</nowiki>''  ^  ''<nowiki>{{page>:action_table}}</nowiki>''  ^^
</div>
\\

Latest revision as of 06:58, 5 August 2020

Code Snippets[edit]

This page exists as a reference for quick code that can be copy-pasted into wiki pages easily.


Pasted as the first line in an article, makes a nice disambiguation line

^ %%

<wrap help>If you meant the keyword unique to Nazgul, see Twilight%% ^

Inserts a card image at about 30% normal zoom that doubles as a link to the card when clicked.

^ %%[[lotr01001|Template:cards:lotr01001.jpg?200]]%% ^

Inserts a link to a card's wiki page. Usually the autolinker works, but occasionally it doesn't, and sometimes you want to avoid typing in the whole name regardless.

^ %%The One Ring, Isildur's Bane%% ^

Used as a direct quote from the Comprehensive Rules. Insert in a section after an explanation of the mechanics is given, to give the article an air of legitimacy.

^ %%From the Comprehensive Rules 4.0:%% ^ ^ %%If such-and-such is true, then the game is won. %% ^ ^ %%See also Another Relevant Section entry in the Comprehensive Guide.%% ^

Redirect (automatically navigates to the redirect_page if the user tries to access it):

^ #REDIRECT [[redirect_page]] ^

To access pages that have a redirect on them, append the following to the end of the URL:

^ ?redirect=====no ^

Copies page_to_reference into the current one:

^ {{:page_to_reference}} ^

Additionally, here are all the table pages that can be referenced:

^ {{:play_area_table}} ^ {{:card_layout_table}} ^^ ^ {{:card_action_table}} ^ {{:game_setup_table}} ^^ ^ {{:culture_table}} ^ {{:card_type_table}} ^^ ^ {{:turn_order_table}} ^ {{:keyword_table}} ^^ ^ {{:loaded_keyword_table}} ^ {{:unloaded_keyword_table}} ^^ ^ {{:electronic_platform_table}} ^ {{:set_table}} ^^ ^ {{:format_table}} ^ {{:action_table}} ^^