Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

druxt-menu

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

druxt-menu

Drupal Menu and Menu item Druxt components, with support for the JSON:API Menu Items module.

  • 0.21.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

DruxtMenu

npm CircleCI Known Vulnerabilities codecov

Drupal Menu and Menu item Druxt components, with support for the JSON:API Menu Items module.

Install

$ npm install druxt-menu

Nuxt.js

Add module to nuxt.config.js

module.exports = {
  modules: ['druxt-menu'],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org',
    menu: {
      query: {
        requiredOnly: true,
        fields: [],
      },
    },
  },
}

Usgae

DruxtMenu component

The DruxtMenu component inteligentally loads in your Drupal menu using the built in JSON:API as well as the Drupal JSON:API Menu Items module.

<DruxtMenu name="main" :depth="1" />

Example DruxtMenu component

See the DruxtMenu API Documentation for more information.

Theming

The DruxtMenu component can be themed by providing a default template:

<DruxtMenu name="main">
  <template #default="{ items }">
    {{ items }}
  </template>
</DruxtMenu>

The module also provides Wrapper components with scoped slots for theming:

<template>
  <div>
    <slot />
  <div>
</template>

See the Druxt Theming guide for more information.

Options

Druxt Menu options

These options are specific to this module.

OptionTypeRequiredDefaultDescription
menu.jsonApiMenuItemsbooleanNofalseUse the Drupal JSON:API Menu Items module resource.
menu.query.fieldsstring[]NofalseAn array of fields to filter all JSON:API Menu queries.
menu.query.requiredOnlybooleanNofalseWhether to automatically filter to module defined minimum required fields.

Base Druxt options

These options are available to all Druxt modules.

OptionTypeRequiredDefaultDescription
axiosobjectNo{}Axios instance settings.
baseUrlstringYesnullBase URL for the Drupal installation.
endpointstringNo/jsonapiJSON:API Endpoint of the Drupal installation.

Keywords

FAQs

Package last updated on 08 Jan 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc