Difference between revisions of "Template:ListEdges"

From AtlasWiki
Jump to: navigation, search
(fix missing close braces for additional arrayprint)
(Support for out edges of the same kind from different node kinds)
Line 52: Line 52:
 
| format=array
 
| format=array
 
| headers=hide
 
| headers=hide
| propsep=$SEP$
 
 
| name=outEdges
 
| name=outEdges
 
}}<noinclude><!--
 
}}<noinclude><!--
Line 64: Line 63:
 
We print the out edges table:
 
We print the out edges table:
  
--></noinclude>{{#switch:{{#arraysize:outEdges}}| 0 = | #default =  
+
--></noinclude>{{#switch:{{#arraysize:outEdges}}| 0 = | #default =
 
{{{!}} class="xcsgtable"
 
{{{!}} class="xcsgtable"
 
! Out Edge !! Successor (Points To) !! Multiplicity !! Description
 
! Out Edge !! Successor (Points To) !! Multiplicity !! Description
 
{{!}}-
 
{{!}}-
 
{{!}}{{#arrayprint:outEdges|{{!}}-
 
{{!}}{{#arrayprint:outEdges|{{!}}-
{{!}}|var|[[{{#explode:var|$SEP$|0}}]] {{!}}{{!}} [[{{#explode:var|$SEP$|1}}]] {{!}}{{!}} {{#explode:var|$SEP$|2}} {{!}}{{!}} {{ReconstructLinks|{{#explode:var|$SEP$|3}}}} }}
+
{{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}}{{#arrayprint:relationships|&#32;
 +
{{!}}-
 +
{{!}}|@@@@|[[{{#arrayindex:edgeRelationships|0}}]] {{!}}{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} {{!}}{{!}} {{ReconstructLinks|{{#explode:@@@@|$SEP$|2}}}} }} }}
 
{{!}}}  
 
{{!}}}  
 
}}<noinclude><!--
 
}}<noinclude><!--

Revision as of 15:19, 22 April 2014

For use on node kind pages, automatically lists edges declared on the current page.

If the parameter "parents" is given a comma-separated list of the parents of the node, inherited edges will also be listed.