{% if customButtons is defined %}
    {{ buttonsAdd(customButtons) }}
{% endif %}
{# Function used to get identifier string for entity #}
{% set nameGetter = nameGetter|default('getName') %}
{# Dropdown direction #}
{% set pull = pull|default('left') %}
{# Custom query parameters for URLs #}
{% set query = query is defined ? query : [] %}
{% if tmpl is defined %}
    {% set query = query|merge({'tmpl': tmpl}) %}
{% endif %}
{# Edit mode for edit/actions (allows use of ajaxmodal) #}
{% set editMode = editMode is defined ? editMode : 'ajax' %}
{% set editAttr = editAttr is defined ? editAttr : [] %}
{% set templateButtons = templateButtons is defined ? templateButtons : [] %}
{# Set langVar to routeBase if not set #}
{% set langVar = langVar is defined ? langVar : (routeBase is defined ? routeBase : '') %}
{% set translationBase = translationBase is defined ? translationBase : 'mautic.' ~ langVar %}
{# Set index and action routes #}
{% if route is defined and actionRoute is not defined %}
    {% set actionRoute = route %}
{% elseif actionRoute is not defined %}
    {% set actionRoute = '' %}
    {% if routeBase is defined %}
        {% set actionRoute = ('mautic_' ~ routeBase|replace({'mautic_': ''}) ~ '_action') %}
    {% endif %}
{% endif %}
{% set indexRoute = routeBase is defined ? ('mautic_' ~ routeBase|replace({'mautic_': ''}) ~ '_index') : actionRoute %}
{% set routeVars = routeVars is defined ? routeVars : [] %}
{# Extra HTML to be inserted after the buttons #}
{% set extraHtml = extraHtml is defined ? extraHtml : '' %}
{# Wrapper such as li #}
{% set wrapOpeningTag = wrapOpeningTag is defined ? wrapOpeningTag : '' %}
{% set wrapClosingTag = wrapClosingTag is defined ? wrapClosingTag : '' %}
{{ buttonSetWrappingTags(wrapOpeningTag, wrapClosingTag) }}
{# Builder for custom buttons #}
{% set menuLink = menuLink is defined ? ' data-menu-link="' ~ menuLink ~ '"' : '' %}
{{ buttonSetMenuLink(menuLink) }}
{# Set a default button type (group or dropdown) #}
{% if groupType is defined %}
    {{ buttonSetGroupType(groupType) }}
{% endif %}
{% set buttonCount = buttonGetCount() %}
{# Workaround to pass variables back to the parent template #}
{{ save('action_button_helper') }}
