Template:Get data page

From Prismata Wiki
Jump to: navigation, search
Template-info.png Documentation

This is a simple template that performs two functions:

  • It sets the page name given in the first parameter to the data_page var.
  • It then transcludes the given page as if it were a template.

It isn't intended to be directly used. Instead, infoboxes such as {{Unit infobox}} use it in a Cargo query of a table such as Unit_data_pages that finds the appropriate data page and then passes it to this template.

Example of usage (from inside an infobox template):

{{#cargo_query:
   table=Unit_data_pages
  |fields=CONCAT(Unit_data_pages._pageName)
  |where={{#if: {{{testdatapage|}}}
    |Unit_data_pages._pageName="{{{testdatapage}}}"
    |{{#if:{{{datapage|}}}
      |Unit_data_pages._pageName="Data:Units/{{{datapage}}}"
      |Unit_data_pages.name="{{#if:{{{name|}}}|{{{name}}}|{{#titleparts:{{PAGENAME}} }} }}"
    }}
  }}
  |group by=Unit_data_pages._pageName
  |format=template
  |template=Get data page
  |more results text=
  |limit=1
  |no html
}}