0.1.3 • Published 3 years ago
@druxt-contrib/config-pages v0.1.3
DruxtConfigPages
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
- DruxtJS: https://druxtjs.org
- Community Discord server: https://discord.druxtjs.org
- Config Pages project page: https://www.drupal.org/project/config_pages
Install and setup
Drupal
Install and enable the Drupal Config Pages module on your Druxt backend.
Create at least one Config Page type and entity:
/admin/structure/config_pages/typesAdd the "View the foo config page entity" permission to the required Druxt role(s).
Nuxt.js
Install the Nuxt modules:
$ npm install druxt @druxt-contrib/config-pagesAdd module to
nuxt.config.jsmodule.exports = { buildModules: ['@druxt-contrib/config-pages'], druxt: { baseUrl: 'https://demo-api.druxtjs.org', configPages: { pages: ['foo'] } } }Note: Replace
foowith the machine name of your Config Page type.
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
druxt.configPages.pages | array | Yes | [] | An array of Config Page types. |