0.1.3 • Published 1 year ago

@druxt-contrib/config-pages v0.1.3

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

DruxtConfigPages

npm Known Vulnerabilities CI codecov

Decoupled Drupal configuration pages for Druxt

The DruxtConfigPages module consumes configuration data from the Drupal Config Pages module and makes it easily accessible with a Vuex store and Nuxt plugin.

$druxtConfigPages.get('foo.bar')

Features

  • Nuxt plugin:
    • $druxtConfigPages.get('foo').bar
    • $druxtConfigPages.get('foo.bar')
  • Vuex store and getter:
    • $store.getters['druxtConfigPages/foo'].bar

Links

Install and setup

Drupal

  1. Install and enable the Drupal Config Pages module on your Druxt backend.

  2. Create at least one Config Page type and entity: /admin/structure/config_pages/types

  3. Add the "View the foo config page entity" permission to the required Druxt role(s).

Nuxt.js

  1. Install the Nuxt modules:

    $ npm install druxt @druxt-contrib/config-pages

  2. Add module to nuxt.config.js

    module.exports = {
      buildModules: ['@druxt-contrib/config-pages'],
      druxt: {
        baseUrl: 'https://demo-api.druxtjs.org',
        configPages: {
          pages: ['foo']
        }
      }
    }

    Note: Replace foo with the machine name of your Config Page type.

Options

OptionTypeRequiredDefaultDescription
druxt.configPages.pagesarrayYes[]An array of Config Page types.