Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

$typeclass and description
currentItemProvider

info.magnolia.ui.editor.CurrentItemProviderDefinition

Returns the parent node. Suitable for sub-forms only since it relies on a parent.

Warning

Do not use currentItemProvider with multi fields. The same nodes could be resolved by multiple fields that use currentItemProvider, which means their content would be overwritten. Additionally, if a multi field is not configured to resolve nodes strictly (the strict property is set to false by default), it will resolve irrelevant nodes from the parent and likely result in errors.

Note

If you use currentItemProvider with composite or switchable fields, make sure that none of the inner field names clash with:

  • Other inner field names at the level where currentItemProvider is used
  • Other field names one level up where the composite or switchable field is defined

That is, every field at every level must have a unique name. Otherwise, nodes sharing the same name could be resolved by multiple fields that use currentItemProvider, which means their content would be overwritten.

Code Block
languageyml
titleExample name conflict
collapsetrue
form:
  properties:
    first_compositeField:
      $type: compositeField
      itemProvider:
        $type: currentItemProvider 
      properties:
        inner_simple: # duplicate name
          $type: textField # first text
        inner_simple2:
          $type: textField # second text
    second_compositeField:
      $type: compositeField
      itemProvider:
        $type: currentItemProvider
      properties:
        inner_simple3:
          $type: textField # third text
        inner_simple: # duplicate name
          $type: textField # fourth text – first text is overwritten
        inner_simple3:
          $type: textField #

# Problem with using currentItemProvider
currentItem:
  inner_simple: fourth text # first text is overwritten by inner_simple in second_compositeField
  inner_simple2: second text
  inner_simple3: third text

# Using jcrChildNodeProvider with both composite fields would fix the problem
currentItem:
  first_compositeField:
    properties:
      inner_simple: # first text
      inner_simple2: # second text
  second_compositeField:
    properties:
      inner_simplesimple3: # fourththird text
  no name conflict
    inner_simple3simple: # thirdfourth text – no name conflict

For JCR data source

$typeclass and description
jcrChildNodeProvider

info.magnolia.ui.editor.JcrChildNodeProviderDefinition

Resolves a JCR child node from the parent. Suitable for sub-forms only since it relies on a parent.

Info

From Magnolia 6.2.4, jcrChildNodeProvider is used by default in 

Javadoc resource link
classNameinfo.magnolia.ui.field.JcrMultiFieldDefinition
renderTypeasynchronous
.

jcrGetIndexedChildNode

info.magnolia.ui.editor.JcrIndexedChildNodeProvider

Resolves an indexed JCR child node from the parent. Suitable for sub-forms only since it relies on a parent.

jcrGetProperty

info.magnolia.ui.editor.JcrPropertyProvider

Proposes a JCR node property as an item datasource. Typically used in complex fields with sub-editors where a single field entry needs to be exposed as an editor.

jcrNodeFromLocationProvider

info.magnolia.ui.editor.JcrNodeFromLocationResolutionDefinition

Resolves JCR node content from the current location.

...