Skip to content

section_title

The section_title macro is used to render a title of a section.

Definition

{% macro section_title(title, options) %}

Input parameters

title

string a text content of a title.

options

object represents an object of title attributes

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

Example

Here is an example of a section title with an additional class.

{{ section_title('My title', {
    cssClasses: 'color_success-500'
}) }}

Macro source code

{% macro section_title(title, options) %}
    {% if title %}
        <h1 class="section-title {{ options.cssClasses }}">{{ title }}</h1>
    {% endif %}
{% endmacro %}