Skip to content

Commit

Permalink
Merge pull request #504 from webhdx/EZP-29295_2nd_level_menu_context
Browse files Browse the repository at this point in the history
EZP-29295: Second level of main menu has no context passed
  • Loading branch information
Łukasz Serwatka authored Jun 13, 2018
2 parents 7a721cd + 0a38c57 commit c65d431
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bundle/Resources/views/parts/navigation.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{% set main_menu_context = {
'location': location ?? null,
'content': content ?? null
} %}
{% set main_menu = knp_menu_get('ezplatform_admin_ui.menu.main', [], main_menu_context) %}

<nav class="navbar navbar-expand-sm navbar-light ez-main-nav" style="flex-wrap:wrap;">
<div class="container-fluid">
<a href="{{ url('ezplatform.dashboard') }}" class="navbar-brand">
Expand All @@ -7,7 +13,6 @@
</a>
<div class="collapse navbar-collapse">
<ul class="nav nav-tabs" role="tablist">
{% set main_menu = knp_menu_get('ezplatform_admin_ui.menu.main', [], {'location': location is defined ? location : null, 'content': content is defined ? content : null}) %}
{{ knp_menu_render(main_menu, {
'depth': 1,
'template': '@EzPlatformAdminUi/parts/menu/top_menu.html.twig',
Expand Down Expand Up @@ -37,7 +42,7 @@
</div>
</nav>
<nav class="navbar navbar-expand-sm navbar-light ez-main-sub-nav" style="flex-wrap:wrap;">
{{ knp_menu_render('ezplatform_admin_ui.menu.main', {
{{ knp_menu_render(main_menu, {
'depth': 2,
'template': '@EzPlatformAdminUi/parts/menu/top_menu_2nd_level.html.twig',
'currentClass': 'active',
Expand Down

0 comments on commit c65d431

Please sign in to comment.