0 Votes

Wiki source code of Top panel menu documentation

Last modified by Ryan C on 2025/04/15 21:52

Show last authors
1 {{box cssClass="floatinginfobox" title="**Summary table**"}}
2 {{toc numbered="true" depth="3"/}}
3 {{/box}}
4
5 = List of pages composing the menu =
6 The root of the children pages that compose the menu is [[CustomExtension.TopPanelMenu.Content.WebHome]] (CustomExtension.TopPanelMenu.Content.WebHome). Every children page should be created on this location and using specific name (with their title custumized).
7
8 Below the listing of the pages composing the menu:
9 * Links with the page name followed by (**Title of the page**) and their content: **the pages naming is important**.
10 (Appear in yellow and large characters, pages that are incorrectly named and must be renamed and / or moved without redirection.)
11
12 ** Note: ** prefixes names of pages to use are: ** Tab - ** xx // (Title to modify) // -> ** Col - ** xx -> ** Listitem - ** xx // (Title to modify) //. // xx is a number to sort the menu items.//
13
14 {{velocity}}
15 #set($MyDoc=$xwiki.getDocument("CustomExtension.TopPanelMenu.Content.WebHome"))
16 #set ($depth = 3)
17 #set ($limit = 10)
18 #set($TabPrefx = 'Tab-')
19 #set($colPrefx = 'Col-')
20 #set($ListPrefx = 'Listitem-')
21 #macro (children $parentDoc $level)
22 #foreach ($child in $parentDoc.getChildren($limit, 0))
23 #set ($childDoc = $xwiki.getDocument($child))
24 #set($ParentName=$childDoc.documentReference.parent.name)
25 #if ($ParentName.startsWith("$ListPrefx")||$ParentName.startsWith("$TabPrefx")||$ParentName.startsWith("$colPrefx"))
26 #set ($ErrorColor = ' ')
27 #else
28 #set ($ErrorColor = ' style="background-color: yellow;font-size: large;" ')
29 #end
30 $stringtool.repeat('*', $level) (%$ErrorColor%)[[$childDoc]](%%) (**$escapetool.xml($childDoc.plainTitle)**)
31 #if ($ParentName.startsWith("$ListPrefx"))
32 (% class="box infomessage" %)(((
33 {{include reference="$childDoc" /}}
34 )))
35 #end
36 #if ($level < $depth)
37 #children ($childDoc $mathtool.add($level, 1))
38 #end
39 #end
40 #end
41 ## Call children macro above
42 #children ($MyDoc 1)
43
44 {{/velocity}}
45
46 = Expandable menu structure =
47 The deployable menu is composed of
48 * tabs (Tab-xx)
49
50 The expanded menu when clicking on a tab displays:
51 * one or more columns (Col-xx)
52 * and 1 to several links (or text) groups: (Listitem-xx)
53
54 All code is in [[CustomExtension.TopPanelMenu.Content.WebHome]] and the children pages contain the list of shortcuts (Listitem-xx).
55
56
57 To add a tab in menu (**Tab-xx**), you have to create a children page, in [[CustomExtension.TopPanelMenu.Content.WebHome>>CustomExtension.TopPanelMenu.Content.WebHome]] location, named "Tab-xx" (xx is usually a number to sort tabs) and the page title, the tab label to displayed.
58
59 To add a column (**Col-xx**) in the expanded menu, you have to create a children page, in "CustomExtension.TopPanelMenu.Content.Tab-xx.WebHome" location, named "Col-xx" (xx to sort columns).// The title does not matter here // eg [[CustomExtension.TopPanelMenu.Content.Tab-01.Col-01.WebHome>>CustomExtension.TopPanelMenu.Content.Tab-01.Col-01.WebHome]]
60
61 To add a shortcut group (** Listitem-xx **), simply create a children page of "CustomExtension.TopPanelMenu.Content.Tab-xx.Col-xx.WebHome" with the name "Listitem-xx" ( xx to sort groups) and the page title, the title of the links group, eg [[CustomExtension.TopPanelMenu.Content.Tab-01.Col-01.Listitem-01.WebHome>>CustomExtension.TopPanelMenu.Content.Tab-01.Col-01.Listitem-01.WebHome]] Links are added to this page as a bulleted list.
62
63 There aren't terminal page.
64
65 To delete a links group, a column or a tab, simply delete the page concerned and its childrens pages.
66 It is possible to move a group of links, a column or a tab, just move the page and its childrens pages (uncheck redirection) taking care to move it to the correct location (** tree: Content-> Tab- xx-> Col-xx-> Listitem-xx **) and name the page correctly: Tab-xx, Col-xx, Listitem-xx
67
68 To navigate in the different pages to create / modify the menu, it is wise to use the breadcrumb.

XWiki AI Chat