项目作者: collective

项目描述 :
Volto addon for a customizable dropdown menu
高级语言: JavaScript
项目地址: git://github.com/collective/volto-dropdownmenu.git
创建时间: 2020-08-19T10:03:17Z
项目社区:https://github.com/collective/volto-dropdownmenu

开源协议:

下载


volto-dropdownmenu

Volto addon for a customizable dropdown menu.
Intended to be used with collective.volto.dropdownmenu

To be used with mrs-developer, see Volto docs for further usage informations.

Created with voltocli.

Installation

Afer installation, please add following lines into package.json to enable it.

  1. "addons": [
  2. "volto-dropdownmenu"
  3. ],

Usage

If you are using Volto < 16, then use v2.4.3

If you are using Volto < 12, then use v1.3.0

Simply load the addon in your project, then edit the configuration in /controlpanel/dropdown-menu-settings.
Example configuration to be saved in Plone here.

To use the default template for the dropdown menu, add src/addons/volto-dropdownmenu/src/customizations in your package.json in customizationPaths.

  1. "customizationPaths": [
  2. "src/customizations",
  3. "src/addons/volto-dropdownmenu/src/customizations"
  4. ]

To customize the MenuConfigurationForm component, you can now create your own component in your site and replace it using the Volto component registry in your site config file:

  1. import MyMenuConfigurationForm from './src/MyMenuConfigurationForm';
  2. config.registerComponent({
  3. name: 'MenuConfigurationForm',
  4. component: MyMenuConfigurationForm,
  5. });

Navigation roots

By default, navigations roots are clickable, but there’s the possibility to make them not clickable.
Enabling the field ‘clickableNavigationRoots’ in volto-dropdownmenu config, a field appears in configuration form and let editor to decide if make navigation roots clickable or not.

  1. config.settings["volto-dropdownmenu"] = {
  2. "options": {
  3. "clickableNavigationRoots": true, //if true, a checkbox option in dropdown menu appears
  4. },
  5. };

Screenshots and demo

Controlpanel

Addon controlpanel

Dropdown menu

Dropdown menu

Demo

You can watch a demonstration video on YouTube