Difference between revisions of "Template:Examples"

From Wikispooks
Jump to navigation Jump to search
(expr->expression)
(Upgrade to use SMWDocSection)
Line 6: Line 6:
  
 
[[Category:Semantic Templates]]
 
[[Category:Semantic Templates]]
</noinclude><includeonly>{{#ifexpr:{{#ask: [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]|format=count}}>0|
+
</noinclude><includeonly>
== Example{{#ifexpr:{{#ask: [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]|format=count}}>1|s|&nbsp;{{PAGENAME}}}} on WikiSpooks==
+
{{SMWDocSection
{{#ifexpr:{{#ask: [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]|format=count}}>1|<small>''Use the Up/Dn symbols to sort''</small>|}}
 
{{#if: {{#show: [[-Has key properties::{{PAGENAME}}]]}}|<!-- Key properties specified, so use them to display the document table -->
 
{{ask
 
 
|expression= [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
 
|expression= [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
|mainlabel={{PAGENAME}}
+
|captionSingular=An example on WikiSpooks
|format=table
+
|captionPlural=Examples on WikiSpooks
|properties={{#show: {{PAGENAME}} | ?Has key properties}}
+
|mainlabel = Wikispooks page
|headers={{#show: {{PAGENAME}} | ?Has key property headers}}
+
|properties={{#if: {{#show: [[-Has key properties::{{PAGENAME}}]]}}|{{#show: {{PAGENAME}} | ?Has key properties}}|DocType/Has publication date/Is about/Description}}
}}
+
|headers={{#if: {{#show: [[-Has key properties::{{PAGENAME}}]]}}|{{#show: {{PAGENAME}} | ?Has key property headers}}|Document type/Publication date/Subject(s)/Description}}
|<!-- No key properties known, so use the default set for documents -->
+
}}</includeonly>
{{#ask: [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
 
|mainlabel=Title
 
|?Is about=Subject(s)
 
|?Has author=Author(s)
 
|?Has publication date=Publication date
 
|format=table
 
}}}}}}</includeonly>
 

Revision as of 17:51, 1 January 2014

This template can be used on any pages which might have example documents. It has no parameters.

If there are any example documents, it places a heading:

Example(s) on WikiSpooks

Plus a table of examples under this heading