User Tools

Site Tools


wiki:apw:the-menu

This is an old revision of the document!


Creating your own menu

The menu used on this version has been completely re-written and the code and script that generates it simplified

A single menu is generated and used in either the bar menu at the top of the screen or in the sidebar menu. As a result, both menus are identical in structure although different styling has been applied to both. One consequence of this is that Font-Awsome® icons are not supported in the top level menu items.

Both menus only respond to click events and will close any open dropdown if you click another link.

menu.js
menuSrc = [
	{title: "Now",                  url: "index.html"},
	{title: "Today",                url: "today.html"},
	{title: "Yesterday",            url: "yesterday.html"},
	{title: "Today V Yesterday",    url: "todayyest.html"},
	{title: "Gauges",               url: "gauges.html"},
	{title: "Records",              submenu: true,    items: [
		{title: "This Month",       icon:"",        url: "recordsthismonth.html"},
		{title: "This Year",        icon:"",        url: "recordsthisyear.html"},
		{title: "All Time",         icon:"",        url: "recordsalltime.html"},
		{title: "Monthly",          icon:"",        url: "recordsmonthly.html"},
		{title: "-"},
		{title: "All Records",		icon:"",		url: "recordsall.html"},
	]},
	{title: "Charts",               submenu: true,    items: [
		{title: "Trends",           icon: "fa-solid fa-chart-column",  url: "chartstrends.html"},
		{title: "Select-a-graph",   icon:"fa-solid fa-chart-line", url: "chartsselect.html"},
		{title: "Historic",         icon:"fa-solid fa-chart-simple", position: 'right',    url: "chartshistoric.html"}
	]},
	{title: "Reports",   url: "noaareports.html"},
	{title: "Forum",     forum: true,    new_window: true},
	{title: "Webcam",    webcam: true}
];

What it all means

Title

The 'Title' entry is used to set what will appear in the menu. Remember that as this is what gets displayed, long entries could cause your menu to wrap which should really be avoided. This element is required.
Menu bars

URL

This is the web address of the page to display. For pages on this site, it should be relative to sites main pages. If it needs to link to an external page it must start with 'http(s)://'.
Important

This flags that the following section should be formatted as a dropdown menu. If it is present and true then it must be followed with the keyword items and a [ bracket. The whole section must then end with a closing ].
Information

Icon

'icon' is used to inject a font-awsome® icon into the menu. It should include both icon classes but can include additional font-awsome® classes and / or ow-themeX classes.Information

new_window

Setting this to true will cause the target page to open in a new window. Information Note | You are responsible for the formatting of this page. If it is under your control, then use a template page to hold the image / video so that it follows the same style as the rest of the site. If not under your control then I suggest you make it open in a new window - see above. ++

wiki/apw/the-menu.1776767499.txt.gz · Last modified: by Neil Thomas