🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

webhandle-menus-1

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webhandle-menus-1

A set of tools for rendering menus for static sites

1.0.10
latest
Source
npm
Version published
Weekly downloads
2
-90.48%
Maintainers
0
Weekly downloads
 
Created
Source

Webhandle Menu loader

Loads menu definitions from a folder ('menus' by default.)

Install

It's installed when using the webhandle framework.

Usage

This operates as a page preload routine. By default, it loads the file main.json in the menus directory. The assumption is that this is the main top menu.

To load a different file from that directory as the main menu, you can specify in the page json file like:

{
	"menuName": "something-else"
}

Whatever is specified by menuName, the root of the menu tree is put into res.locals.menu and the individual items are put into res.locals.menuItems.

To have it load additional menus, add to the page json like this:

{
	"menuName": "something-else",
	"menuNames": ["how-to"]
}

The root will be added to res.locals.menus['how-to]

Keywords

menu

FAQs

Package last updated on 30 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts