Difference between revisions of "Template:Display image"

From Wikispooks
Jump to navigation Jump to search
(test 1)
 
(test2)
Line 1: Line 1:
 
<noinclude>[[category:Semantic Utility Templates]]'''This is a semantic utility template to allocate [[Property:Display image]].'''<br/>
 
<noinclude>[[category:Semantic Utility Templates]]'''This is a semantic utility template to allocate [[Property:Display image]].'''<br/>
 
The logic is as follows:<br>
 
The logic is as follows:<br>
* If the page [[Property:Has logo|Has logo]], and that file exists, then use that.
+
*'' If the page [[Property:Has logo|Has logo]], and that file exists, then use that.
* Elseif the page [[Property:Has image|Has image]], and that file exists, then use that.
+
*'' Elseif the page [[Property:Has image|Has image]], and that file exists, then use that.
* Else use an icon derived from the page's [[Property:Object class|Object class]].
+
*'' Else use an icon derived from the page's [[Property:Has objectClass2|Has objectClass2]].
  
 
Usage:
 
Usage:
  <nowiki>{{</nowiki>{{PAGENAME}}|''Pagename''}}<nowiki>}}</nowiki></noinclude><includeonly>{{#ifexpr: {{#ask:[[-Has logo::{{{1}}}]]|format=count}}>0|x|y}}<includeonly>
+
  <nowiki>{{</nowiki>{{PAGENAME}}|''Pagename''}}<nowiki>}}</nowiki></noinclude><includeonly>{{#ifexpr: {{#ask:[[-Has logo::{{{1}}}]]|format=count}}>0|logo|
 +
{{#ifexpr: {{#ask:[[-Has image::{{{1}}}]]|format=count}}>0|image|{{#ask:[[-Has objectClass2::{{{1}}}]]}}.png}}}<includeonly>

Revision as of 04:45, 13 July 2015

This is a semantic utility template to allocate Property:Display image.
The logic is as follows:

  • If the page Has logo, and that file exists, then use that.
  • Elseif the page Has image, and that file exists, then use that.
  • Else use an icon derived from the page's Has objectClass2.

Usage:

{{Display image|Pagename}}}}