Jump to content

Template:Tree list: Difference between revisions

incorporated the /branching and /end subpages into this template
(+docs)
(incorporated the /branching and /end subpages into this template)
 
Line 1: Line 1:
<includeonly><div class="treeview"></includeonly><noinclude>
<includeonly>{{#ifeq:{{{1|}}}|end|</div>|{{#ifeq:{{{1|}}}|branch|<li class="emptyline">|<div class="treeview">}}}}</includeonly><noinclude>
'''Tree list''' is a simple template that calls upon some CSS in [[MediaWiki:Common.css]] to change the appearance of bulleted lists so that they have continuous connected lines. This makes hierarchical relationships much easier to follow with the eye. You open a tree list by simply invoking the template and then typing a bullet list, but make sure to close the list with [[Template:Tree list/end]] afterward.
'''Tree list''' is a simple template that calls upon some CSS in [[MediaWiki:Common.css]] to change the appearance of bulleted lists so that they have continuous connected lines. This makes hierarchical relationships much easier to follow with the eye. You open a tree list by simply invoking the template and then typing a bullet list, but make sure to close the list with the call <code><nowiki>{{Tree list|end}}</nowiki></code> afterward.
  <nowiki>{{Tree list}}</nowiki>
  <nowiki>{{Tree list}}</nowiki>
  * The CEO
  * The CEO
Line 13: Line 13:
  **** Salesman 3
  **** Salesman 3
  **** Salesman 4
  **** Salesman 4
  <nowiki>{{Tree list/end}}</nowiki>
  <nowiki>{{Tree list|end}}</nowiki>
:'''''yields:'''''
:'''''yields:'''''
{{Tree list}}
{{Tree list}}
Line 27: Line 27:
**** Salesman 3
**** Salesman 3
**** Salesman 4
**** Salesman 4
{{Tree list/end}}
{{Tree list|end}}




Now, what if you want to show a node as a child of a previous parent in the list, not the parent of the current list of children? You invoke [[Template:Tree list/branching]]. The three asterisks before the call to branching means "End the list of children of the last third-level parent".
Now, what if you want to show a node as a child of a previous parent in the list, not the parent of the current list of children? You call <code><nowiki>{{Tree list|branch}}</nowiki></code>. The three asterisks before the "branch" call below tells the list "This is the end of the children of the last third-level parent".


  <nowiki>{{Tree list}}</nowiki>
  <nowiki>{{Tree list}}</nowiki>
Line 44: Line 44:
  **** Salesman 3
  **** Salesman 3
  **** Salesman 4
  **** Salesman 4
  *** <nowiki>{{Tree list/branching}}</nowiki>
  *** <nowiki>{{Tree list|branch}}</nowiki>
  **** Corporate spy 1
  **** Corporate spy 1
  **** Corporate spy 2
  **** Corporate spy 2
  <nowiki>{{Tree list/end}}</nowiki>
  <nowiki>{{Tree list|end}}</nowiki>
:'''''yields:'''''
:'''''yields:'''''
{{Tree list}}
{{Tree list}}
Line 61: Line 61:
**** Salesman 3
**** Salesman 3
**** Salesman 4
**** Salesman 4
*** {{Tree list/branching}}
*** {{Tree list|branch}}
**** Corporate spy 1
**** Corporate spy 1
**** Corporate spy 2
**** Corporate spy 2
{{Tree list/end}}
{{Tree list|end}}




Line 81: Line 81:
  **** Salesman 3
  **** Salesman 3
  **** Salesman 4
  **** Salesman 4
  ** <nowiki>{{Tree list/branching}}</nowiki>
  ** <nowiki>{{Tree list|branch}}</nowiki>
  *** Corporate spy 1
  *** Corporate spy 1
  *** Corporate spy 2
  *** Corporate spy 2
  <nowiki>{{Tree list/end}}</nowiki>
  <nowiki>{{Tree list|end}}</nowiki>
:'''''yields:'''''
:'''''yields:'''''
{{Tree list}}
{{Tree list}}
Line 98: Line 98:
**** Salesman 3
**** Salesman 3
**** Salesman 4
**** Salesman 4
** {{Tree list/branching}}
** {{Tree list|branch}}
*** Corporate spy 1
*** Corporate spy 1
*** Corporate spy 2
*** Corporate spy 2
{{Tree list/end}}
{{Tree list|end}}


[[Category:Basic formatting templates]]
[[Category:Basic formatting templates]]
</noinclude>
</noinclude>