Difference between revisions of "Template:Concept/render relation as list item"

From TDWG Terms Wiki
Jump to: navigation, search
m (output if/else local links vs external URIs)
(adjusted to support https access)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<includeonly><!--  
 
<includeonly><!--  
 
  -->{{#vardefine: relationProperty|{{#sub: {{{1}}}|{{#expr: {{#pos:{{{1}}}|:}} + 1 }} }} }}<!--  
 
  -->{{#vardefine: relationProperty|{{#sub: {{{1}}}|{{#expr: {{#pos:{{{1}}}|:}} + 1 }} }} }}<!--  
  -->{{#vardefine: foundResultList|{{#show: {{{userparam|{{PAGENAME}} }}}|?{{#var: relationProperty}} }} }}<!--  
+
  -->{{#vardefine: foundResultList|{{#ask: [[{{{userparam|{{PAGENAME}} }}}]]|?{{#var: relationProperty}}#= | mainlabel=- | link=none | format=list | default= | limit=50 }} }}<!--  
 
-->{{#if: {{#var: foundResultList}}<!--
 
-->{{#if: {{#var: foundResultList}}<!--
 
then-->|
 
then-->|
* [[{{{1}}}|{{{2}}}]] = {{#arraymap: {{#var: foundResultList}}<!--
+
* ''[[{{{1}}}|{{{2}}}]]'' &nbsp; {{#arraymap: {{#var: foundResultList}}<!--
 
   -->|,<!-- sep
 
   -->|,<!-- sep
 
   -->|§<!-- temporary var
 
   -->|§<!-- temporary var
Line 11: Line 11:
 
     then
 
     then
 
     explode  12            3↓  4↓ → make local link
 
     explode  12            3↓  4↓ → make local link
         http://terms.gbif.org/wiki/dcterms:rights
+
         http://terms.tdwg.org/wiki/dcterms:rights
     -->|[[{{#explode: §|/|4}}]]<!--
+
     -->|[[{{#sub: §|{{#len: https://terms.tdwg.org/wiki/}}}}]]<!--
 
     else
 
     else
 
     http
 
     http
 
     -->|§<!--
 
     -->|§<!--
 
     -->}}<!-- end if
 
     -->}}<!-- end if
   -->|,&#32;<!--output sep
+
   -->|<nowiki></nowiki>,&#32;<!--output sep
 
   -->}}<!-- end arraymap  
 
   -->}}<!-- end arraymap  
 
-->}}<!-- end if foundResultList
 
-->}}<!-- end if foundResultList
 
--></includeonly><noinclude>
 
--></includeonly><noinclude>
 +
Sub page of [[Template:Concept]], it renders a relation as a list item. Data input is from an #ask query iterating through all applicable properties.
 +
 
Parameters
 
Parameters
 
* <nowiki>{{{1}}}</nowiki>: a property page name (the #sub/#pos removes "Property:", e.g. "Property:biorel:derives_from" → "biorel:derives_from")  
 
* <nowiki>{{{1}}}</nowiki>: a property page name (the #sub/#pos removes "Property:", e.g. "Property:biorel:derives_from" → "biorel:derives_from")  
Line 26: Line 28:
 
* <nowiki>{{{userparam}}}</nowiki>: passed by the calling ask query
 
* <nowiki>{{{userparam}}}</nowiki>: passed by the calling ask query
  
 +
See also:
 +
* [[Template:Concept/render relation as form link]]
 
[[Category: SMW ask template]]
 
[[Category: SMW ask template]]
 
</noinclude>
 
</noinclude>

Latest revision as of 07:56, 2 May 2017

Sub page of Template:Concept, it renders a relation as a list item. Data input is from an #ask query iterating through all applicable properties.

Parameters

See also: