Template:Scryfall search: Difference between revisions

From MTG Wiki
Jump to navigation Jump to search
>Jerodast
(Create raw search option for simpler direct multi-part search without using {{{add}}})
>Jerodast
(display for raw search)
Line 2: Line 2:
   -->{{#ifeq:{{{2}}}|raw<!--
   -->{{#ifeq:{{{2}}}|raw<!--
     -->|{{urlencode:{{{1}}}}}<!-- raw search: exactly as given, no prefix, no enclosure
     -->|{{urlencode:{{{1}}}}}<!-- raw search: exactly as given, no prefix, no enclosure
    --><!--
     --><!--
     --><!--
     -->|{{#if:{{{2|}}}|{{{2}}}%3A}}<!-- adds the search type if given; %3A is a URL-encoded colon :
     -->|{{#if:{{{2|}}}|{{{2}}}%3A}}<!-- adds the search type if given; %3A is a URL-encoded colon :
Line 15: Line 14:
   -->{{#if:{{{display|}}}<!-- if you want to display something different than the search phrase
   -->{{#if:{{{display|}}}<!-- if you want to display something different than the search phrase
     -->|{{#replace:{{{display}}}|]|&#93;}}<!-- closing bracket is escaped do avoid issue with the wiki formatting.
     -->|{{#replace:{{{display}}}|]|&#93;}}<!-- closing bracket is escaped do avoid issue with the wiki formatting.
     -->|{{#if:{{{2|}}}<!-- else display search itself (no custom display)
     -->|{{#ifeq:{{{2}}}|raw<!-- else display search itself (no custom display)
      -->|{{{2}}}:<!-- first the search type (if any)
      -->|{{#replace:{{{1}}}|]|&#93;}}<!-- raw search - exactly as given, other than closing bracket escape
        -->{{#ifeq:{{{2}}}|is<!-- again if the search type is "is", skip the quotations  
      -->|{{#if:{{{2|}}}<!--
          -->|{{#replace:{{{1}}}|]|&#93;}}<!--
        -->|{{{2}}}:<!-- first the search type (if any)
          -->|{{{enclose|"}}}{{#replace:{{{1}}}|]|&#93;}}{{{enclose|"}}}}}<!--
          -->{{#ifeq:{{{2}}}|is<!-- again if the search type is "is", skip the quotations  
      -->|{{{1}}}<!-- else plain/name search display (no search type specified)
            -->|{{#replace:{{{1}}}|]|&#93;}}<!--
            -->|{{{enclose|"}}}{{#replace:{{{1}}}|]|&#93;}}{{{enclose|"}}}}}<!--
        -->|{{{1}}}<!-- else plain/name search display (no search type specified)
      -->}}<!--
     -->}}<!--
     -->}}<!--
   -->}}<!--
   -->}}<!--

Revision as of 01:10, 4 April 2023

 Template Documentation[view | edit | history | purge]
This is a template documentation subpage for Template:Scryfall search.
It contains usage information, categories, interlanguage links and other content that is not part of the original template page.

Parameters

  • {{{1}}}: Search phrase. Required.
  • {{{2}}}: Search type (is, watermark, lore, fulloracle, artist, etc. Use "raw" if you want search exactly the search phrase.)
  • {{{enclose}}}: Defaults to ", can be set to / to enable regular expressions
  • {{{display}}}: If another thing then the search phrase should be displayed
  • {{{color}}}: Choose the exact color to be selected
  • {{{add}}}: Make the search more specific
  • {{{date}}}: The date of the search

Other usage notes

  • Use {{!}} to stand in for a pipe character | for use in regular expression search.
  • Use {{=}} to stand in for an equals sign = for use in regular expression search or with numerical fields.
  • Pages using this template display warnings and appear on Category:Pages with template calls missing required parameters if they do not provide the required {{{1}}} parameter.

Examples

The above documentation is transcluded from Template:Scryfall search/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories and interwikis to the /doc subpage. Subpages of this template.