Template:Tree list: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(let's try out this template from WP)
 
(+docs)
 
Line 1: Line 1:
<includeonly><div class="treeview"></includeonly><noinclude>
<includeonly><div class="treeview"></includeonly><noinclude>
Documentation goes here.
'''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.
<nowiki>{{Tree list}}</nowiki>
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
<nowiki>{{Tree list/end}}</nowiki>
:'''''yields:'''''
{{Tree list}}
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
{{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".
 
<nowiki>{{Tree list}}</nowiki>
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
*** <nowiki>{{Tree list/branching}}</nowiki>
**** Corporate spy 1
**** Corporate spy 2
<nowiki>{{Tree list/end}}</nowiki>
:'''''yields:'''''
{{Tree list}}
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
*** {{Tree list/branching}}
**** Corporate spy 1
**** Corporate spy 2
{{Tree list/end}}
 
 
However if you want to show the children on this level as belonging to an even higher-level parent, this does not seem to be possible without visual glitches. This is only an issue if you're committed to the idea of showing children at a specified level of indentation. The solution is to bump up the children a level. Note the reduction in asterisks to both the branching call and the subsequent employees.
 
<nowiki>{{Tree list}}</nowiki>
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
** <nowiki>{{Tree list/branching}}</nowiki>
*** Corporate spy 1
*** Corporate spy 2
<nowiki>{{Tree list/end}}</nowiki>
:'''''yields:'''''
{{Tree list}}
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
** {{Tree list/branching}}
*** Corporate spy 1
*** Corporate spy 2
{{Tree list/end}}


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

Latest revision as of 03:58, 6 December 2023

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}}
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
{{Tree list/end}}
yields:
  • The CEO
    • VP of Manufacturing
      • Assembly line supervisor
        • Assembly line worker 1
        • Assembly line worker 2
    • VP of Sales
      • Regional sales manager
        • Salesman 1
        • Salesman 2
        • Salesman 3
        • Salesman 4


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".

{{Tree list}}
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
*** {{Tree list/branching}}
**** Corporate spy 1
**** Corporate spy 2
{{Tree list/end}}
yields:
  • The CEO
    • VP of Manufacturing
      • Assembly line supervisor
        • Assembly line worker 1
        • Assembly line worker 2
    • VP of Sales
      • Regional sales manager
        • Salesman 1
        • Salesman 2
        • Salesman 3
        • Salesman 4
        • Corporate spy 1
        • Corporate spy 2


However if you want to show the children on this level as belonging to an even higher-level parent, this does not seem to be possible without visual glitches. This is only an issue if you're committed to the idea of showing children at a specified level of indentation. The solution is to bump up the children a level. Note the reduction in asterisks to both the branching call and the subsequent employees.

{{Tree list}}
* The CEO
** VP of Manufacturing
*** Assembly line supervisor
**** Assembly line worker 1
**** Assembly line worker 2
** VP of Sales
*** Regional sales manager
**** Salesman 1
**** Salesman 2
**** Salesman 3
**** Salesman 4
** {{Tree list/branching}}
*** Corporate spy 1
*** Corporate spy 2
{{Tree list/end}}
yields:
  • The CEO
    • VP of Manufacturing
      • Assembly line supervisor
        • Assembly line worker 1
        • Assembly line worker 2
    • VP of Sales
      • Regional sales manager
        • Salesman 1
        • Salesman 2
        • Salesman 3
        • Salesman 4
      • Corporate spy 1
      • Corporate spy 2