Skip to content

list_description

The list_description macro is used to render a description of a list.

Definition

{% list_description(content, options) %}

Input parameters

description

string represents a text content of the description element.

options (optional)

object represents an object of list description options

Option key Type Default Required Description
options.cssClasses string "" yes A list of styling classes that will be added to the description

Example

Here is an example of a basic list description

{% from "@macros/list_description.twig" import list_description %}

{{ list_description('Example description') }}

Example

Here is an example of a list description with additional styling classes.

{{ list_description('Example description', {
    cssClasses: 'color_success-500 font_bold'
}) }}

Macro source code

{% macro list_description(description, options) %}
    {% if description %}
        <div class="section-description {{ options.cssClasses }}">{{ description | raw }}</div>
    {% endif %}
{% endmacro %}