Browse Source

Put bredcrumb in main nav

Hugo Briand 11 years ago
parent
commit
083468e659
2 changed files with 43 additions and 27 deletions
  1. 13 2
      Resources/public/css/styles.css
  2. 30 25
      Resources/views/standard_layout.html.twig

+ 13 - 2
Resources/public/css/styles.css

@@ -15,6 +15,10 @@ body {
     width: 100%;
 }
 
+.sonata-bc #page-wrapper {
+    padding-top: 10px;
+}
+
 /*#page-wrapper {*/
     /*padding: 15px 15px 0;*/
     /*min-height: 568px;*/
@@ -54,8 +58,15 @@ body {
 
 /* breadcrumb */
 
-.sonata-bc ol.breadcrumb {
-    margin-top: 8px;
+.sonata-bc .breadcrumb {
+    padding: 0;
+    margin: 0;
+    background: inherit;
+    float:left;
+}
+
+.sonata-bc .breadcrumb li a {
+    display: inline-block;
 }
 
 /* top right */

+ 30 - 25
Resources/views/standard_layout.html.twig

@@ -120,7 +120,37 @@ file that was distributed with this source code.
                                 {% endblock %}
                             </div>
 
+
+
                             <div class="collapse navbar-collapse">
+                                {% block sonata_breadcrumb %}
+                                    {% if _breadcrumb is not empty or action is defined %}
+                                        <div class="col-md-6">
+                                            <ol class="nav navbar-top-links breadcrumb">
+                                                {% if _breadcrumb is empty %}
+                                                    {% if action is defined %}
+                                                        {% for menu in admin.breadcrumbs(action) %}
+                                                            {% if not loop.last  %}
+                                                                <li>
+                                                                    {% if menu.uri is not empty %}
+                                                                        <a href="{{ menu.uri }}">{{ menu.label }}</a>
+                                                                    {% else %}
+                                                                        {{ menu.label }}
+                                                                    {% endif %}
+                                                                </li>
+                                                            {% else %}
+                                                                <li class="active">{{ menu.label }}</li>
+                                                            {% endif %}
+                                                        {% endfor %}
+                                                    {% endif %}
+                                                {% else %}
+                                                    {{ _breadcrumb|raw }}
+                                                {% endif %}
+                                            </ol>
+                                        </div>
+                                    {% endif %}
+                                {% endblock sonata_breadcrumb %}
+
                                 {% block sonata_top_nav_menu %}
                                     <ul class="nav navbar-top-links navbar-right">
                                         <li class="dropdown">
@@ -215,31 +245,6 @@ file that was distributed with this source code.
 
                     <div class="row">
                         <div class="col-sm-12">
-                            {% block sonata_breadcrumb %}
-                                {% if _breadcrumb is not empty or action is defined %}
-                                    <ol class="breadcrumb">
-                                        {% if _breadcrumb is empty %}
-                                            {% if action is defined %}
-                                                {% for menu in admin.breadcrumbs(action) %}
-                                                    {% if not loop.last  %}
-                                                        <li>
-                                                            {% if menu.uri is not empty %}
-                                                                <a href="{{ menu.uri }}">{{ menu.label }}</a>
-                                                            {% else %}
-                                                                {{ menu.label }}
-                                                            {% endif %}
-                                                        </li>
-                                                    {% else %}
-                                                        <li class="active">{{ menu.label }}</li>
-                                                    {% endif %}
-                                                {% endfor %}
-                                            {% endif %}
-                                        {% else %}
-                                            {{ _breadcrumb|raw }}
-                                        {% endif %}
-                                    </ol>
-                                {% endif %}
-                            {% endblock sonata_breadcrumb %}
                         </div>
                     </div>