Deprecated formatters

This article covers deprecated formatters for DOCX, XLSX and PPTX templates.

hide-block-if-not

Note

A current alternative for this formatter is hide-block-if formatter with conditions.

It is applied if a value in the tag is not equal to the value of the parameter. The formatter can be used to conditionally hide a single block of the document. It works in the rich text content control or repeatable sections such as list items or table rows. Thus, if you need to hide some atbitrary block, it is necessary to put it in a list item or table cell with invisible borders.

{{property}:hide-block-if-not(val)}

Note

To hide items from an array, we recommend to use the filter operation instead of the current formatter. The latter should be used only for hiding arbitrary blocks.

Examples

The formatter can be used in DOCX, XLSX, and PPTX templates. However, in XLSX templates, it behaves differently. Read the articles below for more information:

Template

Data

{{count}:hide-block-if-not(1)}
{
    "count": 2
}
{{employee.name}:hide-block-if-not(Jessica)}
{
    "employee": {
        "name": "John"
    }
}

hide-block-if-empty

Note

A current alternative for this formatter is hide-block-if-nothing formatter; hide-block-if-empty renders a value of a current token in addition to hiding the block.

It is applied if a value in the tag is null, an empty string or array. The formatter can be used to conditionally hide a single block of the document. It works in the rich text content control or repeatable sections such as list items or table rows. Thus, if you need to hide some atbitrary block, it is necessary to put it in a list item or table cell with invisible borders.

{{property}:hide-block-if-empty}

Note

To hide items from an array, we recommend to use the filter operation instead of the current formatter. The latter should be used only for hiding arbitrary blocks.

Examples

The formatter can be used in DOCX, XLSX, and PPTX templates. However, in XLSX templates, it behaves differently. Read the articles below for more information:

Template

Data

{{property}:hide-block-if-empty}
{
    "property": null
}

{
    "property": ""
}

{
    "property": []
}