Template:CR: Difference between revisions

From MTG Wiki
Jump to navigation Jump to search
>@DeletedUser40397020
(rm extra newline (Be careful to put <noinclude> DIRECTLY after the last thing that should be transcluded or you will get extra spacing!))
>Corveroth
(Prettier output for missing CR indices)
Line 1: Line 1:
<includeonly>{{#invoke:CR|CRTemplateCall|toc={{{toc|}}}|exact={{{exact|}}}|lookup={{{lookup}}}}}</includeonly><noinclude>
<includeonly>{{#iferror:{{#invoke:CR|CRTemplateCall|toc={{{toc|}}}|exact={{{exact|}}}|lookup={{{lookup}}}}}|| "No [[Comprehensive Rules]] entry currently exists for the specified index."}}</includeonly><noinclude>
==Usage==
==Usage==
'''Template:CR''' accepts either a code index or title to transclude. Either of the two following examples should produce the same output, unless a rules update after this edit shifts the numerical indexing within the Comprehensive Rules. Because of that possibility, '''using the title of a rules section is recommended where possible.'''
'''Template:CR''' accepts either a code index or title to transclude. Either of the two following examples should produce the same output, unless a rules update after this edit shifts the numerical indexing within the Comprehensive Rules. Because of that possibility, '''using the title of a rules section is recommended where possible.'''

Revision as of 21:39, 11 November 2015

Usage

Template:CR accepts either a code index or title to transclude. Either of the two following examples should produce the same output, unless a rules update after this edit shifts the numerical indexing within the Comprehensive Rules. Because of that possibility, using the title of a rules section is recommended where possible.

{{CR|lookup=Ending the Game}}
{{CR|lookup=104}}

Result: "No Comprehensive Rules entry currently exists for the specified index." Result: "No Comprehensive Rules entry currently exists for the specified index."


In addition, Template:CR allows two optional parameters for cases where additional granularity is required. By their nature, use of optional parameters requires the use of indices, not titles.

  • toc limits the transcluded text to one level of nesting within the rules, appropriate for making a table of contents or giving an overview.
Wikitext: {{CR|toc=true|lookup=8}}

Result: "No Comprehensive Rules entry currently exists for the specified index."

  • exact limits the transluded text to only the index specified, without any nested subsections.
Wikitext: {{CR|exact=true|lookup=105.2}}

Result: "No Comprehensive Rules entry currently exists for the specified index."