Skip to main content
Skip table of contents

Layout Styles

Structure

{placeholder 1}

{placeholder 2}

Behavior

Using a layout style in combination with a LayoutNode activates the layout mode and allows the placement of nodes into predefined slots.

  • Each cell in the layout style can have one more slots. Multiple slots are separated by paragraphs. An alternative to multiple slots per cell is to use a NoOpNode.

  • The placeholder / slot name should be in the format of: {slotname}.

  • If no style is defined in the LayoutNode the children are placed in the flow mode instead.

  • There is a special case for certain children of layout nodes. ParagraphNode that are direct children of a LayoutNode use the style that is defined in the layout style’s cell and not the style that is defined on the ParagraphNode.

Metadata

Layout styles only allow default styles to be defined.

Examples

Example 1: Showing a simple case with one placeholder

abstract-report-layout_simple_case.json template-layout_simple_case.docx output-layout_simple_case.docx

Example 2: Showing multiple slots per cell

output-layout_multiple_slots_per_cell.docx abstract-report-layout_multiple_slots_per_cell.json template-layout_multiple_slots_per_cell.docx

Example 3: Showing how to place multiple children per slot by using a NoOpNode

abstract-report-layout_multiple_children_noop_node.json template-layout_multiple_children_noop_node.docx output-layout_multiple_children_noop_node.docx

Example 4: Showing how to enforce the flow mode by not specifying a style

output-layout_flow_mode.docx template-layout_flow_mode.docx abstract-report-layout_flow_mode.json

Example 5: Showing how paragraph nodes are handled

template-layout_paragraph_node.docx abstract-report-layout_paragraph_node.json output-layout_paragraph_node.docx

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.