Skip to content

Drupal Content Entity schema generator for Druxt with support for View and Form displays.

DruxtSchemaStore

View source on GitHub

DruxtSchemaStore

Vuex module, registered under the druxtSchema namespace. The druxtSchema Vuex module.

Provides a Vuex state object, mutations and actions for interacting with the Druxt Schemas.

See: The DruxtStore


get(resource) ⇒ Schema

Get a schema.
Vuex Action => Mutates state propertyschema

Kind: action method of druxtSchema
Returns: Schema - The Druxt Schema object.

ParamTypeDescription
resourceSchemaConfigurationThe requested resource schema configuration object.

Example

const schema = await this.$store.dispatch('druxtSchema/get', { resourceType: 'node--page' })

state : state

The Vuex State object.


addSchema

Kind: mutation method of druxtSchema

ParamTypeDescription
statestateThe Vuex State object.
dataaddSchemaPayloadSchema object and ID to be committed.

Example

this.$store.commit('druxtSchema/addSchema', { id, schema })

state : object

The Vuex State object.

Kind: global typedef
Properties

NameTypeDescription
schemasobjectDruxt Schemas, keyed by Schema ID.

addSchemaPayload : object

Parameters for the addSchema mutation.

Kind: global typedef

ParamTypeDescription
idstringThe Schema ID.
schemaobjectThe Schema object.

Example

{
  id: 'node--page--default--view',
  schema: {}
}

Schema : object

The Druxt Schema object.

Kind: global typedef
See: Schema


SchemaConfiguration : object

Druxt Schema configuration object.

Kind: global typedef
See: SchemaConfiguration