Difference between revisions of "User:Philmasterplus/TemplateSandbox"

From Kolmafia
Jump to navigation Jump to search
(Replaced content with "...")
Tag: Replaced
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{{1|{{{error|Missing parameter '1' for Template:Data}}}}}}{{{2|{{{error|Missing parameter 'field' for Template:Data}}}}}}
+
...
{{#ifexist:{{{1}}}
 
|{{
 
  {{{1}}}
 
  |format=#switch:{{{2}}}
 
  |{{{3}}}
 
}}
 
|{{{error|Page '{{{1}}}' does not exist in Template:Data}}}
 
}}</includeonly>
 
<noinclude>
 
<templatedata>
 
{
 
  "description": "Utility template that extracts a field from a specially formatted page.",
 
  "params": {
 
    "1": {
 
      "label": "Page name",
 
      "description": "Name of the source page to extract the data from. The source page is evaluated as a #switch-statement.",
 
      "type": "wiki-page-name",
 
      "required": true,
 
      "example": "visit_url"
 
    },
 
    "2": {
 
      "label": "Field name",
 
      "description": "Field name to extract from the source page.",
 
      "type": "line",
 
      "required": true,
 
      "example": "function1.parameter1"
 
    },
 
    "3": {
 
      "label": "Default value",
 
      "description": "Default value if the page does not contain the given field",
 
      "type": "string",
 
      "example": "no_name"
 
    }
 
  }
 
}
 
</templatedata>
 
 
 
This template is similar to [https://kol.coldfront.net/thekolwiki/index.php/Template:Data Template:Data] in the KoL Coldfront Wiki.
 
</noinclude>
 

Latest revision as of 11:51, 25 December 2020

...