Difference between revisions of "Template:Resource info"

From SNIC Documentation
Jump to: navigation, search
Line 20: Line 20:
 
</noinclude><includeonly>{{#ifeq: {{{quiet}}}|true|
 
</noinclude><includeonly>{{#ifeq: {{{quiet}}}|true|
 
{{#set: name={{{name|{{PAGENAME}}}}}|description={{{description}}}|centre={{{centre}}}}}{{#if: {{{description|}}}||<span style="font-weight: bold; color: red;">ERROR: No description.</span>}}{{#if: {{{centre|}}}||<span style="font-weight: bold; color: red;">ERROR: No centre.</span>}}|
 
{{#set: name={{{name|{{PAGENAME}}}}}|description={{{description}}}|centre={{{centre}}}}}{{#if: {{{description|}}}||<span style="font-weight: bold; color: red;">ERROR: No description.</span>}}{{#if: {{{centre|}}}||<span style="font-weight: bold; color: red;">ERROR: No centre.</span>}}|
[[name::{{{name|{{PAGENAME}}}}}]] is [[description::{{{description|<span style="font-weight: bold; color: red;">ERROR</span>}}}]], and is located at [[centre::{{{centre|<span style="font-weight: bold; color: red;">ERROR</span>}}}]].}}{{set list|software|{{{software|}}}|sep=,|quiet=true}}
+
[[name::{{{name|{{PAGENAME}}}}}]] is a [[description::{{{description|<span style="font-weight: bold; color: red;">ERROR</span>}}}]], and is located at [[centre::{{{centre|<span style="font-weight: bold; color: red;">ERROR</span>}}}]].}}{{set list|software|{{{software|}}}|sep=,|quiet=true}}
 
[[Category:Resource]]</includeonly>
 
[[Category:Resource]]</includeonly>

Revision as of 19:00, 9 September 2011

This template and registers the relevant categories and properties for a resource. Will protest loudly in bold red if mandatory information is missing. If you do not wish to provide a certain piece of required information: do not use this template. Or else you will corrupt the database with incorrect information.

Usage: {{resource info|description=|centre=|name={{PAGENAME}}}}

All the parameters are named, and can be given in any order. description should be a shortest-possible style description of what the resource is, eg. it should fit into the second formatter of "%s is a %s." (note absence of capital first letter, leading word "a", and ending full stop character). name defaults to {{PAGENAME}} and should in principle never have to be set to anything else.

The only readable output produced by this template is the string "name is a description, and is located at centre.", but even that can be suppressed by setting quiet=true. If you do, you may want to add something like "{{PAGENAME}} is a {{#show: {{PAGENAME}}|?description}}, and is located at {{#show: {{PAGENAME}}|?centre}}." to the page instead.

Example:

{{resource info
|description=a capability cluster resource of 250 Tflops with full bisection interconnect
|centre=NSC
|software=a comma separated list of pagenames for installed software
}}