Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MOTION-157

...

class

required

The fully-qualified class name for the Java bean representing the definition of the block. Needs to be a subtype of info.magnolia.block.BlockDefinition.

The default implementation of info.magnolia.block.BlockDefinition can be extended for convenience.

For blocks wrapping one or multiple form fields, there is a built-in info.magnolia.editor.block.stock.FieldSetBlockDefinition which expects an additional fields property listing the form fields.

blockClass

optional ((warning) A default value is already a part of the definition, so there's in fact no need to specify it in the definition YAML file.)

The fully-qualified class name for the Java bean representing the block. Needs to be a subtype of info.magnolia.block.Block.

templateId

required

The ID of the template definition in <module name>:<path to block definition> format, for example my-module:blocks/quotation.

fields

required only for the FieldSetBlockDefinition class, unavailable for the default and other definitions

Defines what field types are available in the block.

icon

optional, default is icon-help-mark

Defines the icon used by the Block chooser toolbar.

name

optional

A custom i18n base name used by the BlockDefinitionKeyGenerator to generate a key for the block, for example the name singleTextRow in the i18n key blocks.singleTextRow.label.

By default the block's name in the JCR is used.

label

optional

An i18n label for the block, for example the value A text row block in the key-value pair blocks.textRow.label=A text row block.

Example

my-module:blocks/quotation.ftl
Localtab Group
Localtab
activetrue
titleYAML file
Code Block
languageyaml
title/my-module/blocks/quotation.yaml
class: info.magnolia.editor.block.stock.FieldSetBlockDefinition
templateId: my-module:blocks/quotation.ftl
fields:
  textRow:
    class: info.magnolia.ui.form.field.definition.TextFieldDefinition
Localtab
titleJCR node
Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
modules

Mgnl f
<my-module>

Mgnl f
blocks

Mgnl n
quotation

Mgnl n
fields

Mgnl n
textRow

Mgnl p
class

info.magnolia.ui.form.field.definition.TextFieldDefinition

Mgnl p
class

info.magnolia.editor.block.stock.FieldSetBlockDefinition

Mgnl p
templateId

Block template definition

...