User Defined Menu
Introduction
When using the Website Generator the website comes with a standard menu. It is possible to expand this menu by adding items to it. It is not possible to modify the standard menu items or sub-items, it is possible though to remove some items from the main manu by using the parameters, some items cannot be removed. The About menu item cannot be removed nor changed.
The system in use is for historical reasons still called System 2.
Operation
System 1
System 1 has been deprecated and is removed from use in version 8.0.1
System 2
In the utils directory there must be a file CutilsMenu.def. If this file is not present you get the default menu. The contents of this file as delivered in the distribution is shown at the end of this page.
You recognize the standard menu of CumulusUtils. User items can be added to the standard menu as is indicated above. While generating the website this menu will be incorporated.
Items
Any menu topic, named other than the standard items, will create a new user defined, top level menu dropdown. If the top level name contains an underscore, that underscore will be replaced by a space.
The following holds:
- Tab is a valid separator of fields within CutilsMenu.def
- Requires About as last item and Home as first
- Requires the following Top Level items in the CutilsMenu.def (Note that Print is optional):
Home, ToggleDashboard, Reports, Graphs, Records, Extra, Misc, About - The order of items between Home and About is arbitrary
For all drop downs items can be defined as follows:
Item <name> <type> <destination> EndItem
This Item definition line has space separated words.
The <name> is what you will see in the menu and may consist of one or more words (no need to use an underscore in the name to create a space).
If <name> is a valid filespec on the seerver or a valid URL, it will display the contents of that filespec or URL. It is intended to be used as a specification for a small images to be displayed in the menu. It is the users responsibility to have a correct filespec or URL. No validation is done other than:
- <name> starts with
'./' OR '../' - <name> starts with
'http' OR 'https'
In which cases the <name> is interpreted as an URL.
The Type can be of :
- External: The URL given as destination will be opened in a new window or new tab besides CUtils
- Internal: The URL given as destination will be opened in the ReportView, the large viewport on the right side of the dashboard. It is implemented as an Iframe which is generated to the standard demands of Cutils
- Report: Any UserReport of Cutils or any other legitimate HTML/Javascript file similar to the standard reports and charts. The destination is a fully specified text file name : filename.txt (so including the extension)
- Image: The URL for the image (e.g. a satellite image) will be shown in the ReportView
- Separator: No further arguments. Creates a thin horizontal line below the last item
<destination> is the URL of what you want to see. An URL can be a full specification or just a filename in which case the report must be present on the server in the webroot (produced by Cutils or by the user).
Example lines are shown at the bottom of this page and in the distribution file CutilsMenu-example-for-use.def
Errors are shown in the logfile. System 2 however cannot validate against the real world so while developing your menu: be precise or be prepared to rerun if your menu looks garbled.
Garbage in is garbage out.
Output
There is no output of the user menu, only a visible appearance on the website.
System 2 however may produce menufiles on the server of the form: <main menu item><subitem number>.txt.
Inifile parameters
There are no inifile parameters involved
Inner working
The website is designed on the basis of the Bootstrap Toolkit. As a result, the menu is also within this toolkit. As the menu is not really very easy if you are not a HTML / Bootstrap programmer, System 2 for the menu is designed to deal with without knowledge of the Bootstrap menu system. On the basis of the keywords in System 2 CumulusUtils generates the menu for you.
Example of CuserMenu.def (System 2)
The lines below are examples Lines starting with a semicolon (;) are treated as comment
- CumulusUtils Menu definitions for Website- Part of CumulusUtils
Home Reports Graphs Item Extra Report extrasensorscharts.txt EndItem Records Extra Misc Maps User Item ./wu.png External https://www.wunderground.com/dashboard/pws/IWAGEN6?cm_ven=localwx_pwsdash EndItem NL Item Waterstanden External https://waterinfo.rws.nl/#!/kaart/waterhoogte/ EndItem Item TopoNL External https://topotijdreis.nl EndItem Item Hoogtekaart External https://ahn.arcgisonline.nl/ahnviewer/ EndItem Item CropMap External https://www.esa.int/ESA_Multimedia/Images/2018/05/Crop_map EndItem Item Separator EndItem Item Waterstanden (Int) Internal https://waterinfo.rws.nl/#!/kaart/waterhoogte/ EndItem Item TopoNL (Int) Internal https://topotijdreis.nl EndItem ToggleDashboard About