{% if sign_in is defined and sign_in == true %}
    {% import "macros.twig" as menus_macros %}

    {% set public_menus = callstatic('\\Galette\\Core\\Galette', 'getPublicMenus') %}
    {% for public_menu in public_menus %}
        {% for public_item in public_menu.items %}
            {{ menus_macros.renderMenuItem(public_item.label, public_item.title, public_item.route, public_item.icon ?? null, null, tips_position) }}
        {% endfor %}
    {% endfor %}

    {% set public_items = [] %}
    <div class="{% if sign_in_side is defined and sign_in_side is not empty %}right {% endif %}item">
    {% if preferences.pref_bool_selfsubscribe == true and not is_current_url("subscribe") %}
        {% set public_items = public_items|merge([{
            'label': _T("Subscribe"),
            'title': _T("Subscribe"),
            'route': {'name': 'subscribe'},
            'icon': 'add user',
            'class': 'ui basic button'
        }]) %}
    {% endif %}
    {% if not is_current_url("login") %}
        {% set public_items = public_items|merge([{
            'label': _T("Login"),
            'title': _T("Login"),
            'route': {'name': 'slash'},
            'icon': 'sign in alt',
            'class': 'ui primary button'
        }]) %}
    {% endif %}

    {% for public_item in public_items %}
        {{ menus_macros.renderMenuItem(public_item.label, public_item.title, public_item.route, public_item.icon, public_item.class, tips_position) }}
    {% endfor %}
    </div>
{% endif %}
