ソースを参照

fix icon for nav items with on_top: true (#4487)

item.attribute('icon') is not defined, we need to call item.extra('icon').
Otherwise the icon will not be populated to the nav entry which is used together with the on_top-option
Oskar Stark 8 年 前
コミット
81955c296f
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Resources/views/Menu/sonata_menu.html.twig

+ 1 - 1
Resources/views/Menu/sonata_menu.html.twig

@@ -27,7 +27,7 @@
     {% spaceless %}
         {% if item.extra('on_top') is defined and not item.extra('on_top') %}
             {% set translation_domain = item.extra('translation_domain', 'messages') %}
-            {% set icon = item.attribute('icon')|default(item.level > 1 ? '<i class="fa fa-angle-double-right" aria-hidden="true"></i>' : '') %}
+            {% set icon = item.extra('icon')|default(item.level > 1 ? '<i class="fa fa-angle-double-right" aria-hidden="true"></i>' : '') %}
         {% else %}
             {% set icon = item.extra('icon') %}
         {% endif %}