Difference between revisions of "Template:ListEdges"
From AtlasWiki
(adding to Category:XCSG Templates) |
(Now handles multiple in edges of the same type from different node kinds) |
||
Line 6: | Line 6: | ||
| format=array | | format=array | ||
| headers=hide | | headers=hide | ||
− | |||
| name=inEdges | | name=inEdges | ||
}}<noinclude><!-- | }}<noinclude><!-- | ||
Line 14: | Line 13: | ||
Each entry in the array is in this format: | Each entry in the array is in this format: | ||
− | [ | + | [name of edge]<PROP>[name of predecessor]$SEP$[multiplicity]$SEP$[edge description] |
+ | |||
+ | ...except that, if there are multiple entries from the same edge, they will be separated by "<MANY>", | ||
+ | and the name of the edge will not be repeated, i.e., if there are two possible predecessors for a specific | ||
+ | edge type, the format will be: | ||
+ | |||
+ | [name of edge]<PROP>[name of predecessor]$SEP$[multiplicity]$SEP$[edge description]<MANY>[name of other predecessor]$SEP$[multiplicity] | ||
...now we parse those into an "In Edge" table, if and only if there is at least one in edge: | ...now we parse those into an "In Edge" table, if and only if there is at least one in edge: | ||
− | --></noinclude>{{#switch:{{#arraysize:inEdges}}| 0 = | #default = | + | --></noinclude>{{#switch:{{#arraysize:inEdges}}| 0 = | #default = |
{{{!}} class="xcsgtable" | {{{!}} class="xcsgtable" | ||
! In Edge !! Predecessor (Comes From) !! Multiplicity !! Description | ! In Edge !! Predecessor (Comes From) !! Multiplicity !! Description | ||
{{!}}- | {{!}}- | ||
{{!}}{{#arrayprint:inEdges|{{!}}- | {{!}}{{#arrayprint:inEdges|{{!}}- | ||
− | {{!}}|var| | + | {{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}}{{#arrayprint:relationships|  |
+ | {{!}}- | ||
+ | {{!}}|@@@@|[[{{#arrayindex:edgeRelationships|0}}]] {{!}}{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} {{!}}{{!}} {{ReconstructLinks|{{#explode:@@@@|$SEP$|2}}}} }} | ||
{{!}}} | {{!}}} | ||
}}<noinclude><!-- | }}<noinclude><!-- |
Revision as of 15:01, 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. {{#switch:0| 0 = | #default =
In Edge | Predecessor (Comes From) | Multiplicity | Description |
---|---|---|---|