{{< treeview >}}

Description#


The treeview shortcode allows to display a tree structure in various forms.

Parameters#


NameType(named/positional)Description
rootpathnamedTop level tree path.
NB: If not specified, the current page path is used (.).
displaynamed

Styles available:

  • list
  • graph
  • tree

NB: If not specified, the default style is list.

initnamed

Tree behavior at initialization.
Possible values:

  • collapse
  • uncollapse

NB: If not specified, the default behavior is uncollapse.

Examples#


MarkdownRendering
{{</* treeview /*/>}}
No data available
{{</* treeview
    rootpath="/shortcodes"
/*/>}}
{{</* treeview
    rootpath="/shortcodes"
    display="graph"
/*/>}}
{{</* treeview
    rootpath="/shortcodes"
    display="tree"
/*/>}}
{{</* treeview
    rootpath="/shortcodes"
    display="tree"
    init="collapse"
/*/>}}
{{</* treeview
    display="tree"
*/>}}
[{
    "kind": "dir",
    "label": "***Directory***",
    "content": [{
            "kind": "archive",
            "label": "***Archive***",
            "content": [{
                    "kind": "dir",
                    "label": "***Directory** in an archive*",
                    "content": [{
                            "kind": "file",
                            "label": "***Flat file** in a directory in an archive*"
                        }]
                },{
                    "kind": "file",
                    "label": "***Flat file** in an archive*"
                }]
        },{
            "kind": "file",
            "label": "***Flat file** in a directory*"
        }]
},{
    "kind": "default",
    "label": "***Default***"
},{
    "kind": "dir",
    "label": "***Directory***"
},{
    "kind": "file",
    "label": "***File***"
},{
    "kind": "home",
    "label": "***Home***"
},{
    "kind": "page",
    "label": "***Page***"
},{
    "kind": "section",
    "label": "***Section***"
},{
    "kind": "taxonomy",
    "label": "***Taxonomy***"
},{
    "kind": "term",
    "label": "***Taxonomy's term***"
},{
    "kind": "archive",
    "label": "***Archive***"
},{
    "kind": "image",
    "label": "***Image file***"
},{
    "kind": "video",
    "label": "***Video file***"
},{
    "kind": "script",
    "label": "***Script***"
},{
    "kind": "dockerfile",
    "label": "***Dockerfile***"
},{
    "kind": "pdf",
    "label": "***PDF file***"
},{
    "kind": "powerpoint",
    "label": "***PowerPoint file***"
},{
    "kind": "excel",
    "label": "***Excel file***"
},{
    "kind": "csv",
    "label": "***CSV file***"
},{
    "kind": "word",
    "label": "***Word file***"
}]
{{</* /treeview */>}}
  • Directory

    • Archive

      • Directory in an archive

        • Flat file in a directory in an archive

      • Flat file in an archive

    • Flat file in a directory

  • Default

  • Directory

  • File

  • Home

  • Page

  • Section

  • Taxonomy

  • Taxonomy’s term

  • Archive

  • Image file

  • Video file

  • Script

  • Dockerfile

  • PDF file

  • PowerPoint file

  • Excel file

  • CSV file

  • Word file