28 | | For displaying navigation in 'tree' manner, special macro is provided, see details below. |
| 28 | To display the navigation in a 'tree' format, a special macro is provided, see details below. |
| 29 | |
| 30 | === Screenshot |
| 31 | |
| 32 | [[Image(flexiblewikiplugin-scr1.jpg, border=2)]] |
| 33 | |
| 34 | Note the extra navigation item '''New page''' and the extra fields '''Parent page''', '''Hide from menu''', '''Page weight'''. |
| 35 | |
| 36 | The navigation line above the page title is inserted by this plugin automatically. |
| 37 | |
| 38 | Menu in left sidebar is provided by macro {{{[[TracFlexWikiTree]]}}}. It's added globally in site templates, and this plugin doesn't do this automatically. |
| 39 | |
| 40 | === Usage |
| 41 | |
| 42 | This plugin offers the following additional page properties: |
| 43 | |
| 44 | * '''title''': string, just a page title, automatically displayed on top of the page and in the navigation bar |
| 45 | * '''parent''': name of parent wiki page or empty if none |
| 46 | * '''weight''': number, defines page ordering in menu |
| 47 | * '''hide''': flag, if set, page won't appear in menu generated by `[[TracFlexWikiTree]]` |
| 48 | |
| 49 | There is also the following template example: |
| 50 | |
| 51 | Here is a demonstration example with `[[TracFlexWikiTree]]` macro in left sidebar: see in attachment [attachment:site.html] or in source [source:flexiblewikiplugin/0.11/tracflexwiki/templates/site_example.html]. |
| 52 | |
| 53 | === Additional macros |
| 54 | |
| 55 | Plugin provides the following additional wiki macros. |
| 56 | |
| 57 | {{{ |
| 58 | [[TracFlexWikiTree]] |
| 59 | }}} |
| 60 | |
| 61 | Shows wiki pages tree menu. Menu is generated as simple unordered list. Macro receives one optional parameter ''class'', which defines CSS class of menu. |
| 62 | |
| 63 | Example: |
| 64 | {{{ |
| 65 | [[TracFlexWikiTree(class=flex-menu)]] |
| 66 | }}} |
| 67 | |
| 68 | For now, the plugin does not generate initial structure data. So, for existing pages the structure of the data is not provided. That means, they are not displayed in {{{TracFlexWikiTree}}} until you edit and save them. |
| 69 | |
| 70 | === Further development |
| 71 | |
| 72 | Some features are not implemented yet, like '''site map'''. |
| 73 | |
| 74 | Plugin is a bit tricky: it adds extra key {{{'node'}}} to {{{request.args}}}, that is instance of class {{{TracFlexWikiNode}}}, which provides something like API for this plugin. |
| 75 | |
| 76 | Feedback is welcome! |
58 | | 1. Install plugin as any other Trac plugin ([http://trac.edgewall.org/wiki/TracPlugins#InstallingaTracPlugin how to?]) |
59 | | 1. '''Upgrade''' your environment ([http://trac.edgewall.org/wiki/TracUpgrade#UpgradetheTracEnvironment how to?]) |
60 | | 1. Note changes: |
61 | | * you should see '''New page''' button in main menu, if you see it, then plugin is active and working |
62 | | * you will also have extra fields in page edit dialog, see below |
63 | | 1. Incorporate wiki macros ![[TracFlexWikiTree]] and ![[TracFlexWikiChildren]] somewhere in your template or just use them in your pages, there's no sidebar in default Trac templates, so you need manually customize template, see example. |
64 | | |
65 | | '''Extra page properties:''' |
66 | | |
67 | | * '''title''': string, just page title, automatically displayed on top of page and in navigation |
68 | | * '''parent''': name of parent wiki page or empty if none |
69 | | * '''weight''': number, defines page ordering in menu |
70 | | * '''hide''': flag, if set, page won't appear in menu generated by ![[TracFlexWikiTree]] |
71 | | |
72 | | '''Template example''' |
73 | | |
74 | | Here's quick demonstration example with ![[TracFlexWikiTree]] macro in left sidebar: see in attachment [attachment:site.html] or in source [source:flexiblewikiplugin/0.11/tracflexwiki/templates/site_example.html]. |
75 | | |
76 | | === Additional macros |
77 | | |
78 | | Plugin provides extra wiki macros. |
79 | | |
80 | | {{{ |
81 | | [[TracFlexWikiTree]] |
82 | | }}} |
83 | | |
84 | | Shows wiki pages tree menu. Menu is generated as simple unordered list. Macro receives one optional parameter ''class'', wich defines CSS class of menu. |
85 | | |
86 | | Example: |
87 | | {{{ |
88 | | [[TracFlexWikiTree(class=flex-menu)]] |
89 | | }}} |
90 | | |
91 | | For now, plugin does not generate initial structure data. So, for existring pages structure data is not provided. That means, they are not displayed in {{{TracFlexWikiTree}}} until you edit and save them. |
92 | | |
93 | | === Screenshot |
94 | | |
95 | | Here's plugin in work - page editing: [attachment:flexiblewikiplugin-scr1.jpg]. |
96 | | |
97 | | Note extra navigation item ''New page'' and extra fields ''Parent page'', ''Hide from menu'', ''Page weight''. |
98 | | |
99 | | Navigation line above page title is inserted by this plugin automatically. |
100 | | |
101 | | Menu in left sidebar is provided by macro {{{[[TracFlexWikiTree]]}}}. It's added globally in site templates, this plugin doesn't do this automatically. |
102 | | |
103 | | === Further development |
104 | | |
105 | | Some features are not implemented yet, like ''site map'' etc. |
106 | | |
107 | | Plugin is a bit tricky. It adds extra key {{{'node'}}} to {{{request.args}}}, that is instance of class {{{TracFlexWikiNode}}}, which provides something like API for this plugin. |
108 | | |
109 | | Feedback is welcome! |
| 106 | 1. Install the plugin as on the [TracPlugins#InstallingaTracplugin TracPlugins] page. |
| 107 | 1. Upgrade your environment as described on the [t:TracUpgrade#UpgradetheTracEnvironment]) page |
| 108 | 1. Note the following changes: |
| 109 | * you should see '''New page''' button in the main menu. If it is present, then the plugin is active and working. |
| 110 | * you will also have extra fields in the page edit dialog, see below. |
| 111 | 1. Incorporate the wiki macros `[[TracFlexWikiTree]]` and `[[TracFlexWikiChildren]]` somewhere in your template or just use them in your pages. There is no sidebar in the default Trac templates, so you need to manually customize the template, see example. |