Difference between revisions of "Template:DiscoverParents"

From AtlasWiki
Jump to: navigation, search
(fix missing /nowiki tag)
Line 2: Line 2:
 
This template is designed to help in discovering distinct parents that can be reached over "extends" relationships among XCSG elements within a specific number of inheritance steps.
 
This template is designed to help in discovering distinct parents that can be reached over "extends" relationships among XCSG elements within a specific number of inheritance steps.
  
Note that the results of this template will always include the parameters.
+
Note that the results of this template will always include the parameters, and will always trim off the XCSG namespace from both inputs and results.
  
For example: <nowiki>{{DiscoverParents|{{FULLPAGENAME}}}}</nowiki> should return a comma-separated list of parents of the current page, which also includes the current page itself.
+
For example: <nowiki>{{DiscoverParents|{{PAGENAME}}}}</nowiki> should return a comma-separated list of parents of the current page, which also includes the current page itself. <nowiki>{{FULLPAGENAME}}</nowiki> instead should produce exactly the same results.
  
<nowiki>{{DiscoverParents|{{DiscoverParents|{{FULLPAGENAME}}}}</nowiki> should find all parents and grandparents, with each listed only once in case a diamond pattern occurs, and will again include the current page itself.
+
<nowiki>{{DiscoverParents|{{DiscoverParents|{{PAGENAME}}}}</nowiki> should find all parents and grandparents, with each listed only once in case a diamond pattern occurs, and will again include the current page itself.
  
 
To avoid including the current page, combine use of this template with the [[Template:ParentsOf]] template:
 
To avoid including the current page, combine use of this template with the [[Template:ParentsOf]] template:
Line 35: Line 35:
 
Finally, we print out the results as a comma-separated list.
 
Finally, we print out the results as a comma-separated list.
  
--></noinclude>{{#arrayprint:parents|,|}}<noinclude>[[Category:XCSG Templates]]</noinclude>
+
--></noinclude>{{#arrayprint:parents|,|@@@@|{{TrimNamespace|@@@@}}}}<noinclude>[[Category:XCSG Templates]]</noinclude>

Revision as of 15:43, 21 April 2014

This template is designed to help in discovering distinct parents that can be reached over "extends" relationships among XCSG elements within a specific number of inheritance steps.

Note that the results of this template will always include the parameters, and will always trim off the XCSG namespace from both inputs and results.

For example: {{DiscoverParents|{{PAGENAME}}}} should return a comma-separated list of parents of the current page, which also includes the current page itself. {{FULLPAGENAME}} instead should produce exactly the same results.

{{DiscoverParents|{{DiscoverParents|{{PAGENAME}}}} should find all parents and grandparents, with each listed only once in case a diamond pattern occurs, and will again include the current page itself.

To avoid including the current page, combine use of this template with the Template:ParentsOf template:

{{DiscoverParents|{{ParentsOf|{{FULLPAGENAME}}}}}} will return two levels of parents of

This template can also be used to find the union of the parents of two or more unrelated XCSG nodes or edges, for example, this query would find the union of the parents and grand-parents of X and Y: {{DiscoverParents|{{ParentsOf|X}}, {{ParentsOf|Y}}}}

Template},
  • Some part "<nowiki>...</nowiki>" of the query was not understood.
  • The symbol &quot;[[&quot; was used in a place where it is not useful.
  • The part "{1" of the query was not understood. Results might not be as expected.
  • The part "]]" of the query was not understood. Results might not be as expected.
}