{% import 'OroUIBundle::macros.html.twig' as UI %}
{% if buttons|length %}
    {% set renderedButtons = {} %}
    {% set groups = {} %}

    {% for button in buttons %}
        {% set groupName = button.group|default(null) %}
        {% if groupName %}
            {% set link %}
                <li>
                    {% include button.template with button.getTemplateData({'onlyLink': true}) %}
                </li>
            {% endset %}

            {% set groups = groups|merge({(groupName): groups[groupName]|default([])|merge([link])}) %}
        {% else %}
            {% set renderedButton %}
                {% include button.template with button.getTemplateData({'aClass' : 'btn'}) %}
            {% endset %}
            {% set renderedButtons = renderedButtons|merge([renderedButton]) %}
        {% endif %}
    {% endfor %}

    <div class="widget-content">
        <div>
            {% if renderedButtons|length %}
                {{ renderedButtons|join()|raw }}
            {% endif %}
            {% if groups|length %}
                {% for groupName, groupButtons in groups %}
                    {% if renderedButtons %}
                        {{ UI.dropdownButton({
                            'label': groupName|trans,
                            'html': groupButtons|join()
                        }) }}
                    {% endif %}
                {% endfor %}
            {% endif %}
        </div>
    </div>
{% endif %}

{% import 'OroUIBundle::macros.html.twig' as UI %}
{% if buttons|length %}
    {% set renderedButtons = {} %}
    {% set groups = {} %}

    {% for button in buttons %}
        {% set groupName = button.group|default(null) %}
        {% if groupName %}
            {% set link %}
                <li>
                    {% include button.template with button.getTemplateData({'onlyLink': true}) %}
                </li>
            {% endset %}

            {% set groups = groups|merge({(groupName): groups[groupName]|default([])|merge([link])}) %}
        {% else %}
            {% set renderedButton %}
                {% include button.template with button.getTemplateData({'aClass' : 'btn'}) %}
            {% endset %}
            {% set renderedButtons = renderedButtons|merge([renderedButton]) %}
        {% endif %}
    {% endfor %}

    <div class="widget-content">
        <div>
            {% if renderedButtons|length %}
                {{ renderedButtons|join()|raw }}
            {% endif %}
            {% if groups|length %}
                {% for groupName, groupButtons in groups %}
                    {% if groupButtons %}
                        {{ UI.dropdownButton({
                            'label': groupName|trans,
                            'html': groupButtons|join()
                        }) }}
                    {% endif %}
                {% endfor %}
            {% endif %}
        </div>
    </div>
{% endif %}

Add layout’s line_buttons_widget - Fixed typo
BB-5859: Add layout’s line_buttons_widget
- Fixed typo
