Skip to main content
Skip table of contents

Hide objects via formeditor

Using a combination of Template DataKeys and JSON-condition, the user can hide and show certain blocks using a checkbox in the sidetab formeditor when editing templates in the printformer editor.

The following example explains what settings are necessary for this:

formeditor-conditions.png

  1. First, the desired blocks in the IDML file are provided with the condition-json attribute and the following value:

    CODE
    {
        "left": "${DataKey}",
        "operator": "equal",
        "right": false
    }

    The respective DataKeys can be freely named, in our example fullmoon and halfmoon were used.

    SC_condition-hide-objects.png

  2. Now the DataKeys used in the template (condition-json) are (in each case) created as template DataKey in the printformer backend. In the DataKey field, the exact DataKey from the condition must be specified, the Label (display in the form editor) can be freely selected, Checkbox is selected as the type:

    SC_condition-hide-objects2.png

  3. After uploading the template, the Form Editor is activated under Editor (Editor > Form editor > Activate form editor).
    When opening the template in the printformer Editor, the template DataKeys set up are now displayed in the sidebar (under Form editor). The elements are shown or hidden using the checkboxes:

    formeditor-conditions.gif


Sample Template:

moon-example_hide_objects.zip

JavaScript errors detected

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

If this problem persists, please contact our support.