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

pkp/pkp-lib#5199 Set the current page on the top menu - OJS 3.4 #9609

Open
wants to merge 1 commit into
base: stable-3_4_0
Choose a base branch
from
Open
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
19 changes: 15 additions & 4 deletions templates/frontend/components/navigationMenu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,27 @@
{if !$navigationMenuItemAssignment->navigationMenuItem->getIsDisplayed()}
{continue}
{/if}
<li class="{$liClass|escape}">
<a href="{$navigationMenuItemAssignment->navigationMenuItem->getUrl()}">

{* Check if menu item has submenu *}
{if $navigationMenuItemAssignment->navigationMenuItem->getIsChildVisible()}
{assign var=hasSubmenu value=true}
{else}
{assign var=hasSubmenu value=false}
{/if}
{* Check if is current page for aria-current parameter*}
{assign var="isActive" value={default_item_active item=$navigationMenuItemAssignment->navigationMenuItem}}

<li class="{$liClass|escape} main-menu__nav-item{if $hasSubmenu} dropdown{/if} {default_item_active item=$navigationMenuItemAssignment->navigationMenuItem}" >
<a {if $isActive} aria-current="page" {/if}{if $hasSubmenu} aria-current="true"{/if} href="{$navigationMenuItemAssignment->navigationMenuItem->getUrl()}">
{$navigationMenuItemAssignment->navigationMenuItem->getLocalizedTitle()}
</a>
{if $navigationMenuItemAssignment->navigationMenuItem->getIsChildVisible()}
<ul>
{foreach key=childField item=childNavigationMenuItemAssignment from=$navigationMenuItemAssignment->children}
{assign var="isActive2" value={default_item_active item=$childNavigationMenuItemAssignment->navigationMenuItem}}
{if $childNavigationMenuItemAssignment->navigationMenuItem->getIsDisplayed()}
<li class="{$liClass|escape}">
<a href="{$childNavigationMenuItemAssignment->navigationMenuItem->getUrl()}">
<li class="{$liClass|escape} {default_item_active item=$childNavigationMenuItemAssignment->navigationMenuItem}">
<a href="{$childNavigationMenuItemAssignment->navigationMenuItem->getUrl()}" {if $isActive2} aria-current="page" {/if} >
{$childNavigationMenuItemAssignment->navigationMenuItem->getLocalizedTitle()}
</a>
</li>
Expand Down