Versions Compared

Key

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

...

Configure component autogeneration in an area definition, under the autoGeneration item. Simple example:

info.magnolia.rendering.generator.CopyGenerator
single
Localtab Group
Localtab
activetrue
titleYAML file
Code Block
languagejs
areas:
  footer:
    renderType: freemarker
    type: single
    autoGeneration:
      content:
        quotation:
          nodeType: mgnl:component
          templateId: my-module:components/quotation
          quotationText: <p>Carpe diem.</p>
          citedPerson: Horace
      generatorClass: 
info.magnolia.rendering.generator.CopyGenerator
Localtab
titleJCR node
Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl n
areas

 

Mgnl n
footer

 

Mgnl n
autoGeneration

 

Mgnl n
content

 

Mgnl n
quotation

 

Mgnl p
citedPerson

Horace

Mgnl p
nodeType

mgnl:component

Mgnl p
quotationText

<p>Carpe diem.</p>

Mgnl p
templateId

my-module:components/quotation

Mgnl p
generatorClass

Mgnl p
renderType

freemarker

Mgnl p
type

Properties under autogeneration:

content

required

Parent item for autogenerated content. Put everything you want to autogenerate inside this item.

<component name>

required

nodeType

required

Value mgnl:component defines the referenced item as a component and generates a component node.

templateId

required

Component ID in <module>:<path> format that references a component definition .

generatorClass

required , default is info.magnolia.rendering.generator.CopyGenerator

A generator creates nodes based on the definition. The default

Javadoc
0info.magnolia.rendering.generator.CopyGenerator
creates a copy of the exact nodes and properties you define under the content item. You can implement a custom generator class that does something else. Implement the
Javadoc
0info.magnolia.rendering.generator.Generator
interface.