Browse Source

Hide actions if _actions is empty

Added a replace function to check if the list is empty.

Now _actions included a string like '<li></li>' so this was never empty.
NoScopie 11 years ago
parent
commit
1abd7b2926
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Resources/views/standard_layout.html.twig

+ 1 - 1
Resources/views/standard_layout.html.twig

@@ -245,7 +245,7 @@ file that was distributed with this source code.
                                                     {% endif %}
                                                 </div>
 
-                                                {% if _actions is not empty %}
+                                                {% if _actions|replace({ '<li>': '', '</li>': '' })|trim is not empty %}
                                                     <ul class="nav navbar-nav navbar-right">
                                                         <li class="dropdown sonata-actions">
                                                             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions <b class="caret"></b></a>