-
Notifications
You must be signed in to change notification settings - Fork 39
Customizing the menu
The templates producing the menu are in webapps/ROOT/assets/menu
; the one we might want to modify is main.xml.
Menu tabs are represented by the <menu>
element; its attribute @label
is the text that is visible as a tab; @label
is the id of the mapmatch that lists the instruction for generating the page we want to go to after clicking on that tab; @i18n:key
gives us the key for the translation, should we need to have one.
Let's say we want to add a tab in the menu bar that would take us to the indices directly, rather than having to open Inscriptions and following the link from there. We first need to open main.xml and create a new <menu>
element with the @label="Indices"
. We then need to supply in @match
the id of the mapmatch that is creating the page which shows the list of indices. The easiest way to find out which one that is is to copy the url of that page (omitting the string of numbers but including the slash) and use the Introspection option in the Admin panel.
We then copy the id and paste it as the value of the @match
attribute. If we look closely at the mapmatch though we will notice that the @pattern
attribute representing the url that is requesting this page has two variables (*); the first one representing the language code and the second specifying whether the indices are epidoc or tei. EFES can supply the first variable from the context but the second one needs to be added in a @params
attribute like so:
If the url has more than 2 variables, they can be all put in the same @params
attribute separated by a space.