Template:Resources for descriptive keyword

From HopperWiki
Jump to navigation Jump to search

This template was created as a wrapper function for making Cargo queries of HopperWiki's databases. As you can see, the name of the template follows the pattern "X's for Y" where X refers to a Cargo table that is being queried and Y refers to the field in that same Cargo table that is being used to filter the table. This template can be called by passing a string (simple text) or a list of strings separated by commas if more than one result is desired to the `filter_value` argument that corresponds to the value in the focal field you want to use to filter the Cargo table. The result will be a formatted table that will be displayed on the wiki page that calls the template.

Example usage with single value

{{Resources for descriptive keyword|filter_value=item one}}

Example usage with multiple values

{{Resources for descriptive keyword|filter_value=item 1, item 2, item 3}}

Complex usage with multiple values and `not` values

{{Resources for descriptive keyword|filter_value=item 1, item 2, item 3|not_value=item 4, item 5}}

Simpler shortcut usage

A simpler form of using this template is available if the following criteria are met:

  1. The focal field being used corresponds to another theme (i.e. Cargo table) in the wiki (for example the `Species_purview` field in the `Organization` table which corresponds to the separate `Species` table.
  2. The template is being used on a wiki page whose title is the value you want to filter by (e.g. filtering organizations for Schistocerca gregaria on the Schistocerca gregaria page).

If those two criteria are met, then no argument needs to be passed to `filter_value`. The template will obtain this value from the title of the page that it is being used on and the function can be used as such:
{{Resources for descriptive keyword}}