{% load cms_tags sekizai_tags %}{% spaceless %}{# djlint:off #}
{% if instance.child_plugin_instances %}
    {% if parent.plugin_type != "NavigationPlugin" %}<li class="nav-item">
        <li class="{{ item|default:"nav" }}-item {{ drop|default:"dropdown" }}">
    {% else %}
        <div class="{{ item|default:"nav" }}-item  {{ drop|default:"dropdown" }}">
    {% endif %}
        <a class="nav-link" href="{{ instance.get_link }}">{{ instance.name }}</a>
        <ul>
            {% for plugin in instance.child_plugin_instances %}
                {% with forloop=parentloop parent=instance drop="dropend" item="dropdown" %}{% render_plugin plugin %}{% endwith %}
            {% endfor %}
        </ul>
    {% if parent.plugin_type != "NavigationPlugin" %}<li class="nav-item">
        </li>
    {% else %}
        </div>
    {% endif %}
{% else %}
    {% if parent.plugin_type != "NavigationPlugin" %}<li class="{{ item|default:"nav" }}-item">{% endif %}
        <a class="nav-link" href="{{ instance.get_link }}"{% if instance.target %} target="{{ instance.target }}"{% endif %}>{{ instance.name }}</a>
    {% if parent.plugin_type != "NavigationPlugin" %}</li>{% endif %}
{% endif %}{# djlint:on #}
{% endspaceless %}
