Wiki source code of Tree Macro
Last modified by superadmin on 2017/11/28 14:52
| 1 | == Static tree == |
| 2 | |
| 3 | {{tree}} |
| 4 | * [[Chapter 1>>Main.WebHome]] |
| 5 | ** Section 2.1 |
| 6 | ** Section 2.2 |
| 7 | *** Paragraph 2.2.1 |
| 8 | **** Once upon a time... |
| 9 | *** Paragraph 2.2.2 |
| 10 | * [[Chapter 2>>Sandbox.WebHome]] |
| 11 | * [[Chapter 3>>http://www.xwiki.org]] |
| 12 | ** Section 3.1 |
| 13 | *** Paragraph 3.1.1 |
| 14 | ** Section 3.2 |
| 15 | {{/tree}} |
| 16 | |
| 17 | === Static tree with opened path === |
| 18 | |
| 19 | {{tree}} |
| 20 | {{velocity}} |
| 21 | {{html}} |
| 22 | <ul> |
| 23 | <li class="jstree-open"> |
| 24 | <a href="$xwiki.getURL('Main.WebHome')">One</a> |
| 25 | <ul> |
| 26 | <li class="jstree-open"> |
| 27 | <a href="http://www.xwiki.org">Two</a> |
| 28 | <ul> |
| 29 | <li> |
| 30 | <a href="#section" class="jstree-clicked">Three</a> |
| 31 | </li> |
| 32 | </ul> |
| 33 | </li> |
| 34 | </ul> |
| 35 | </li> |
| 36 | </ul> |
| 37 | {{/html}} |
| 38 | {{/velocity}} |
| 39 | {{/tree}} |
| 40 | |
| 41 | === Static tree with custom icons === |
| 42 | |
| 43 | {{tree}} |
| 44 | {{html}} |
| 45 | <ul> |
| 46 | <li data-jstree='{"opened":true,"selected":true}'>Users |
| 47 | <ul> |
| 48 | <li data-jstree='{"disabled":true}'>Alice</li> |
| 49 | <li data-jstree='{"icon":"http://jstree.com/tree.png"}'>Bob</li> |
| 50 | <li data-jstree='{"icon":"glyphicon glyphicon-leaf"}'>Carol</li> |
| 51 | </ul> |
| 52 | </li> |
| 53 | </ul> |
| 54 | {{/html}} |
| 55 | {{/tree}} |
| 56 | |
| 57 | == Dynamic Tree == |
| 58 | |
| 59 | {{tree reference="XWiki.DocumentTree" /}} |
| 60 | |
| 61 | === Dynamic Sub-tree with Checkboxes === |
| 62 | |
| 63 | {{tree reference="doc:XWiki.DocumentTree" root="document:xwiki:Sandbox.WebHome" checkboxes="true" /}} |