nuxtjs-drupal-ce v1.1.4
nuxtjs-drupal-ce - Nuxt.js Drupal Custom Elements Connector
Connects Nuxt.js with Drupal via the Lupus Custom Elements Renderer
Please refer to https://stack.lupus.digital for more info.
Pre-requisites
- A Drupal backend with the Lupus Custom Elements Renderer module installed.
Setup
- Add
nuxtjs-drupal-ce
dependency to your Nuxt project
yarn add nuxtjs-drupal-ce # or npm install nuxtjs-drupal-ce
- Add
nuxtjs-drupal-ce
to themodules
section ofnuxt.config.js
export default defineNuxtConfig({
modules: [
'nuxtjs-drupal-ce',
],
drupalCe: {
baseURL: 'https://your-drupal.example.com',
// more options...
}
})
Options
baseURL
: The Drupal base URL. Defaults to theDRUPAL_BASE_URL
environment variable if provided, otherwise tohttp://localhost:8888
.menuEndpoint
: The menu endpoint pattern used for fetching menus. Defaults to 'api/menu_items/$$$NAME$$$' as fitting to the API provided by the Rest menu items Drupal module.$$$NAME$$$
is replaced by the menu name being fetched.
TODO list of options (not yet implemented)
addRequestFormat
: If set totrue
, the_format=custom_elements
URL parameter is added automatically to requests. Defaults totrue
.addRequestContentFormat
: If specified, the given value is added as_content_format
URL parameter to requests. Disabled by default.useLocalizedMenuEndpoint
: If enabled, the menu endpoint will use a language prefix as configured by nuxtjs/i18n module. Defaults totrue
.useProxy
: If set todev-only
and nuxt is in dev-mode, the module automatically configures/api
to the Drupal backend via @nuxtjs/proxy and uses it instead of the Drupal backend, such that there are no CORS issues. Other values supported arealways
or false. Note: When usingalways
the module must be added to the nuxtmodules
section instead of thebuildModules
section.customErrorPages
: By default, error pages provided by Drupal (e.g. 403, 404 page) are shown, while keeping the right status code. By enabling customErrorPages, the regular Nuxt error pages are shown instead, such that the pages can be customized with Nuxt. Defaults tofalse
.pageErrorHandler
: The default page error handler can be overridden.menuErrorHandler
: The default menu error handler can be overridden.
Options not supported in 2.x version
addVueCompiler
: This is necessary if you want to render custom elements markup on runtime. If you need this, you may find a solution in this GitHub issue.axios
: Options to pass-through to thedrupal-ce
axios instance.
Development
- Clone this repository
- Install dependencies using
npm install
- Use
npm run dev
to start playground in development mode.
- Run
npm run dev:prepare
to generate type stubs.
License
Credits
Development sponsored by drunomics hello@drunomics.com
14 days ago
16 days ago
1 month ago
2 months ago
2 months ago
3 months ago
3 months ago
4 months ago
12 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago