Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: provide fallback if menu isn't translated (resolve #187) #197

Merged
merged 2 commits into from
Feb 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions resources/views/partials/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
@include('partials.search-form')
@endif
<nav aria-labelledby="menu-primary-label">
<button class="button button--borderless menu-toggle" aria-expanded="false">
@svg('menu', 'icon--open', ['focusable' => 'false', 'aria-hidden' => 'true'])
@svg('close', 'icon--close', ['focusable' => 'false', 'aria-hidden' => 'true'])
<span id="menu-primary-label" class="menu-toggle__label">Menu</span>
</button>
@if (has_nav_menu('primary_navigation'))
<button class="button button--borderless menu-toggle" aria-expanded="false">
@svg('menu', 'icon--open', ['focusable' => 'false', 'aria-hidden' => 'true'])
@svg('close', 'icon--close', ['focusable' => 'false', 'aria-hidden' => 'true'])
<span id="menu-primary-label" class="menu-toggle__label">Menu</span>
</button>
{!! wp_nav_menu([
'theme_location' => 'primary_navigation',
'menu_class' => (is_front_page()) ? 'menu menu--home' : 'menu',
Expand All @@ -23,6 +23,11 @@
'after_submenu' => '</ul>',
'walker' => new App\Walker()
]) !!}
@else
<ul class="{{ (is_front_page()) ? 'menu menu--home' : 'menu' }}">
<li class="menu-item"><a class="menu__item" @if(is_post_type_archive('lc_resource')) aria-current="page" @endif href="{{ get_post_type_archive_link('lc_resource') }}">{{ __('Explore', 'coop-library') }}</a></li>
@include('partials.language-switcher')
</ul>
@endif
</nav>
</div>
Expand Down