API Documentation

DruxtBlock

blocks

Modules

DruxtBlock

Renders a Drupal Block by UUID or Drupal's internal ID.

Typedefs

ComponentOptions : Array.<array>

Provides the available naming options for the Wrapper component.

ModuleSettings : object

Provides settings for the Blocks module, via the nuxt.config.js druxt.blocks object.

PropsData : object

Provides propsData for use in the Wrapper component.

ScopedSlots : object

Provides scoped slots for use in the Wrapper component.

DruxtBlock

Renders a Drupal Block by UUID or Drupal's internal ID.

Example

<DruxtBlock id="umami_branding" />

Example

<DruxtBlock uuid="59104acd-88e1-43c3-bd5f-35800f206394" />

.props

The DruxtBlock component requires either the UUID or internal ID property.

Kind: static property of DruxtBlock


.id : string

The Blocks internal ID.

Kind: static property of props
Example

<DruxtBlock id="umami_branding" />

.uuid : string

The Block Entity UUID.

Kind: static property of props
Example

<DruxtBlock uuid="59104acd-88e1-43c3-bd5f-35800f206394" />

.computed

Kind: static property of DruxtBlock


.block ⇒ object

The Block entity data.

Kind: static property of computed


.druxt

Druxt module configuration.

Kind: static property of DruxtBlock


.componentOptions(context) ⇒ ComponentOptions

Provides the available component naming options for the DruxtWrapper.

Kind: static method of druxt

ParamTypeDescription
contextobjectThe module component ViewModel.

.propsData(context) ⇒ PropsData

Provides propsData for the DruxtWrapper.

Kind: static method of druxt

ParamTypeDescription
contextobjectThe module component ViewModel.

.slots() ⇒ ScopedSlots

Provides the scoped slots object for the Module render function.

A default slot is provided with debug information if Nuxt is in development mode.

Kind: static method of druxt
Returns: ScopedSlots - The Scoped slots object.


.data()

Kind: static method of DruxtBlock
Properties

NameTypeDescription
resourceobjectThe JSON:API resource object.

.fetch()

The Nuxt Fetch hook.

Fetches the Block JSON:API resource by either UUID or ID.

Kind: static method of DruxtBlock


ComponentOptions : Array.<array>

Provides the available naming options for the Wrapper component.

Kind: global typedef
Example

[
  'DruxtBlock[Plugin][PluginId][Region][Theme]',
  'DruxtBlock[Plugin][PluginId][Theme]',
  'DruxtBlock[Plugin][Region][Theme]',
  'DruxtBlock[Plugin][Theme]',
  'DruxtBlock[Default]',
]

Example (Umami Branding block)

[
  'DruxtBlockSystemBrandingBlockHeaderUmami',
  'DruxtBlockSystemBrandingBlockHeader',
  'DruxtBlockSystemBrandingBlockUmami',
  'DruxtBlockSystemBrandingBlock',
  'DruxtBlockDefault',
]

ModuleSettings : object

Provides settings for the Blocks module, via the nuxt.config.js druxt.blocks object.

Kind: global typedef

ParamTypeDescription
fieldsArray.<string>An array of fields to filter from the JSON:API Resource.

Example

{
  fields: [],
}

Example (nuxt.config.js)

export default {
  druxt: {
    blocks: {
      query: {
        fields: ['dependencies'],
      },
    },
  },
}

PropsData : object

Provides propsData for use in the Wrapper component.

Kind: global typedef

ParamTypeDescription
blockobjectThe Block Entity data.

Example

{
  block: {
    attributes: {},
    id: '59104acd-88e1-43c3-bd5f-35800f206394',
    links: {},
    relationships: {},
    type: 'block--block',
  },
}

ScopedSlots : object

Provides scoped slots for use in the Wrapper component.

Kind: global typedef

ParamTypeDescription
defaultfunctionDebug information if Nuxt is in development mode.