Browse Source

Merge pull request #1441 from tiagojsag/menu_block

Wrap nav menu in block for easier customization
Thomas 12 years ago
parent
commit
3a89a1a52c
1 changed files with 24 additions and 22 deletions
  1. 24 22
      Resources/views/standard_layout.html.twig

+ 24 - 22
Resources/views/standard_layout.html.twig

@@ -88,28 +88,30 @@ file that was distributed with this source code.
                             </a>
                         {% endblock %}
 
-                        <div class="nav-collapse">
-                            <ul class="nav">
-                                {% block top_bar_before_nav %} {% endblock %}
-                                {% block sonata_top_bar_nav %}
-                                    {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
-                                        {% for group in admin_pool.dashboardgroups %}
-                                            <li class="dropdown">
-                                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ group.label|trans({}, group.label_catalogue) }} <span class="caret"></span></a>
-                                                <ul class="dropdown-menu">
-                                                    {% for admin in group.items %}
-                                                        {% if admin.hasroute('list') and admin.isGranted('LIST') %}
-                                                            <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
-                                                        {% endif %}
-                                                    {% endfor %}
-                                                </ul>
-                                            </li>
-                                        {% endfor %}
-                                    {% endif %}
-                                {% endblock %}
-                                {% block top_bar_after_nav %} {% endblock %}
-                            </ul>
-                        </div>
+                        {% block sonata_nav_menu %}
+                            <div class="nav-collapse">
+                                <ul class="nav">
+                                    {% block top_bar_before_nav %} {% endblock %}
+                                    {% block sonata_top_bar_nav %}
+                                        {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
+                                            {% for group in admin_pool.dashboardgroups %}
+                                                <li class="dropdown">
+                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ group.label|trans({}, group.label_catalogue) }} <span class="caret"></span></a>
+                                                    <ul class="dropdown-menu">
+                                                        {% for admin in group.items %}
+                                                            {% if admin.hasroute('list') and admin.isGranted('LIST') %}
+                                                                <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                            {% endif %}
+                                                        {% endfor %}
+                                                    </ul>
+                                                </li>
+                                            {% endfor %}
+                                        {% endif %}
+                                    {% endblock %}
+                                    {% block top_bar_after_nav %} {% endblock %}
+                                </ul>
+                            </div>
+                        {% endblock %}
                     {% endif %}
                 </div>
             </div>