Difference between revisions of "Template:Display class icon"

From Wikispooks
Jump to navigation Jump to search
(better fallback icon for pages without templates (namespace aware))
m (t)
 
Line 2: Line 2:
 
The logic is:
 
The logic is:
 
* If the page has a [[Property:Has objectClass|Has objectClass]] property, then use that.
 
* If the page has a [[Property:Has objectClass|Has objectClass]] property, then use that.
* Else look at the namespace, and use that.</noinclude><includeonly>{{#if: {{{1|}}}|File:{{#if: {{#show: {{{1}}}|Has objectClass2}}|{{#show: {{{1}}}|?Has objectClass2}}.png|{{#switch: {{NAMESPACE:{{{1|}}}}}
+
* Else look at the namespace, and use that.</noinclude><includeonly>{{#if: {{{1|}}}|File:{{#if: {{#show: {{{1}}}|?Has objectClass2}}|{{#show: {{{1}}}|?Has objectClass2}}.png|{{#switch: {{NAMESPACE:{{{1|}}}}}
 
| =Main.png
 
| =Main.png
 
| Talk = Talk.png
 
| Talk = Talk.png

Latest revision as of 02:25, 16 July 2015

This is a semantic utility template to return the plaintext name of an icon for the page.
The logic is:

  • If the page has a Has objectClass property, then use that.
  • Else look at the namespace, and use that.