Difference between revisions of "Template:Concept/render relation as list item"
From TDWG Terms Wiki
(Created page with "<includeonly> '''{{{1}}} =''' {{ #ask: [[{{{userparam|{{PAGENAME}} }}}]] |? {{{1}}} }}</includeonly><noinclude></noinclude>") |
(adjusted to support https access) |
||
(36 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly> | + | <includeonly><!-- |
− | + | -->{{#vardefine: relationProperty|{{#sub: {{{1}}}|{{#expr: {{#pos:{{{1}}}|:}} + 1 }} }} }}<!-- | |
− | #ask: [[{{{userparam|{{PAGENAME}} }}}]] | + | -->{{#vardefine: foundResultList|{{#ask: [[{{{userparam|{{PAGENAME}} }}}]]|?{{#var: relationProperty}}#= | mainlabel=- | link=none | format=list | default= | limit=50 }} }}<!-- |
− | |? {{{1}}} | + | -->{{#if: {{#var: foundResultList}}<!-- |
− | }}</includeonly><noinclude></noinclude> | + | then-->| |
+ | * ''[[{{{1}}}|{{{2}}}]]'' {{#arraymap: {{#var: foundResultList}}<!-- | ||
+ | -->|,<!-- sep | ||
+ | -->|§<!-- temporary var | ||
+ | -->|<!-- output | ||
+ | -->{{#if: {{#pos: §|{{SERVER}} }}<!-- pos: 0 is true, '' (empty) is false | ||
+ | then | ||
+ | explode 12 3↓ 4↓ → make local link | ||
+ | http://terms.tdwg.org/wiki/dcterms:rights | ||
+ | -->|[[{{#sub: §|{{#len: https://terms.tdwg.org/wiki/}}}}]]<!-- | ||
+ | else | ||
+ | http | ||
+ | -->|§<!-- | ||
+ | -->}}<!-- end if | ||
+ | -->|<nowiki></nowiki>, <!--output sep | ||
+ | -->}}<!-- end arraymap | ||
+ | -->}}<!-- end if foundResultList | ||
+ | --></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 | ||
+ | * <nowiki>{{{1}}}</nowiki>: a property page name (the #sub/#pos removes "Property:", e.g. "Property:biorel:derives_from" → "biorel:derives_from") | ||
+ | * <nowiki>{{{2}}}</nowiki>: [[property: terms-internal:conceptRelationDisplayText]] | ||
+ | * <nowiki>{{{userparam}}}</nowiki>: passed by the calling ask query | ||
+ | |||
+ | See also: | ||
+ | * [[Template:Concept/render relation as form link]] | ||
+ | [[Category: SMW ask template]] | ||
+ | </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
- {{{1}}}: a property page name (the #sub/#pos removes "Property:", e.g. "Property:biorel:derives_from" → "biorel:derives_from")
- {{{2}}}: property: terms-internal:conceptRelationDisplayText
- {{{userparam}}}: passed by the calling ask query
See also: