This page should only be applied if the script assisted migration asks you to skip manual migration skin.20240717.INTRANETSEARCH.rgaa.mainmenu
The main navigation has been redesigned for better keyboard navigation in mobile mode, and for better understanding of navigation menus by assistive technologies.
Here are the changes made and to be reported if the XSL templates concerned have been overloaded.
The <nav class="left" role="navigation" aria-label="Navigation principale"> contenant le logo et le menu principal en mode desktop est maintenant caché en mobile (< 1400px) One element <div class="left mobile"> containing only the logo has been added and is only visible in mobile mode.
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<xsl:template name="header-left">
<nav class="left" role="navigation" aria-label="skin.{$skin}:SKIN_NAV_MAIN_NAVIGATION" i18n:attr="aria-label">
<!-- Logo -->
<xsl:call-template name="header-main-logo"/>
<xsl:call-template name="main-menu">
<xsl:with-param name="device">desktop</xsl:with-param>
</xsl:call-template>
</nav>
<!-- For mobile --> <div class="left mobile"> <xsl:call-template name="header-main-logo"/> </div>
</xsl:template>
<xsl:template name="header-left">
<nav class="left" role="navigation" aria-label="skin.{$skin}:SKIN_NAV_MAIN_NAVIGATION" i18n:attr="aria-label">
<!-- Logo -->
<xsl:call-template name="header-main-logo"/>
<xsl:call-template name="main-menu">
<xsl:with-param name="device">desktop</xsl:with-param>
</xsl:call-template>
</nav>
<!-- For mobile --> <div class="left mobile"> <xsl:call-template name="header-main-logo"/> </div>
</xsl:template>
<xsl:template name="header-left">
<nav class="left" role="navigation" aria-label="skin.{$skin}:SKIN_NAV_MAIN_NAVIGATION" i18n:attr="aria-label">
<!-- Logo -->
<xsl:call-template name="header-main-logo"/>
<xsl:call-template name="main-menu">
<xsl:with-param name="device">desktop</xsl:with-param>
</xsl:call-template>
</nav>
<!-- For mobile --> <div class="left mobile"> <xsl:call-template name="header-main-logo"/> </div>
</xsl:template>
header-icons" template
The <nav role="navigation" aria-label="Menu secondaire" class="icons"> a été remplacé par un <div class="icons">. Notification icons are not navigation elements within the site, but generally external links.
The "burger" button, which opens the main menu in mobile mode, is now surrounded by a <nav role="navigation" aria-label="Menu utilisateur">
Oops!
Copy to clipboard failed. Open the code and copy it manually.
The user menu is now surrounded by a <nav role="navigation" aria-label="Menu utilisateur">. In addition, the scripts for opening/closing the user menu have been reworked for better keyboard navigation and to support menu closure via the ESC key.
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<xsl:template name="user-menu">
<xsl:if test="$currentUser/user/login">
<li class="profil" style="display: none">
<nav role="navigation" aria-label="skin.{$skin}:SKIN_NAV_USER_MENU" i18n:attr="aria-label">
[...]
<xsl:call-template name="profil-img"/>
</nav>
</li>
</xsl:if>
<script type="text/javascript">
const closeUserMenuOnEscape = (event) => {
if (event.key === "Escape") {
var $openUserMenu = $j("header .icons .profil .dropdown.openAccessibility");
$openUserMenu.removeClass('openAccessibility');
$openUserMenu.prev().attr("aria-expanded", "false");
$openUserMenu.prev().focus();
}
}
function openUserMenuOnClick(el)
{
var isOpen = $j(el).next(".dropdown").is(':visible');
if(!isOpen) {
// Open menu
$j(el).next(".dropdown").addClass('openAccessibility');
$j(el).attr("aria-expanded", "true");
$j(el).next(".dropdown").find('ul > li a').first().focus();
$j(el).closest('li').get(0).addEventListener('keydown', closeUserMenuOnEscape);
} else {
// Close menu
$j(el).next(".dropdown").removeClass('openAccessibility');
$j(el).attr("aria-expanded", "false");
$j(el).closest('li').get(0).removeEventListener('keydown', closeUserMenuOnEscape);
}
}
$j(".icons ul li.profil").mouseenter(function (el) {
// Show user menu
var $dropdown = $j(this).find(".dropdown");
if (!$dropdown.is(':visible'))
{
$dropdown.addClass("openAccessibility");
$j(this).find('> button').attr("aria-expanded", true);
}
});
$j(".icons ul li.profil").mouseleave(function (el) {
// Hide user menu
var $dropdown = $j(this).find(".dropdown");
if ($dropdown.is(':visible'))
{
$dropdown.removeClass("openAccessibility");
$j(this).find('> button').attr("aria-expanded", false);
}
});
$j(document).ready(function() {
var _getAmetysUserCb = function(user)
{
if (user)
{
$j('.profil').show();
}
else
{
$j('.profil').hide();
}
}
getAmetysUser(_getAmetysUserCb);
});
</script>
</xsl:template>
<xsl:template name="user-menu">
<xsl:if test="$currentUser/user/login">
<li class="profil" style="display: none">
<nav role="navigation" aria-label="skin.{$skin}:SKIN_NAV_USER_MENU" i18n:attr="aria-label">
[...]
<xsl:call-template name="profil-img"/>
</nav>
</li>
</xsl:if>
<script type="text/javascript">
const closeUserMenuOnEscape = (event) => {
if (event.key === "Escape") {
var $openUserMenu = $j("header .icons .profil .dropdown.openAccessibility");
$openUserMenu.removeClass('openAccessibility');
$openUserMenu.prev().attr("aria-expanded", "false");
$openUserMenu.prev().focus();
}
}
function openUserMenuOnClick(el)
{
var isOpen = $j(el).next(".dropdown").is(':visible');
if(!isOpen) {
// Open menu
$j(el).next(".dropdown").addClass('openAccessibility');
$j(el).attr("aria-expanded", "true");
$j(el).next(".dropdown").find('ul > li a').first().focus();
$j(el).closest('li').get(0).addEventListener('keydown', closeUserMenuOnEscape);
} else {
// Close menu
$j(el).next(".dropdown").removeClass('openAccessibility');
$j(el).attr("aria-expanded", "false");
$j(el).closest('li').get(0).removeEventListener('keydown', closeUserMenuOnEscape);
}
}
$j(".icons ul li.profil").mouseenter(function (el) {
// Show user menu
var $dropdown = $j(this).find(".dropdown");
if (!$dropdown.is(':visible'))
{
$dropdown.addClass("openAccessibility");
$j(this).find('> button').attr("aria-expanded", true);
}
});
$j(".icons ul li.profil").mouseleave(function (el) {
// Hide user menu
var $dropdown = $j(this).find(".dropdown");
if ($dropdown.is(':visible'))
{
$dropdown.removeClass("openAccessibility");
$j(this).find('> button').attr("aria-expanded", false);
}
});
$j(document).ready(function() {
var _getAmetysUserCb = function(user)
{
if (user)
{
$j('.profil').show();
}
else
{
$j('.profil').hide();
}
}
getAmetysUser(_getAmetysUserCb);
});
</script>
</xsl:template>
<xsl:template name="user-menu">
<xsl:if test="$currentUser/user/login">
<li class="profil" style="display: none">
<nav role="navigation" aria-label="skin.{$skin}:SKIN_NAV_USER_MENU" i18n:attr="aria-label">
[...]
<xsl:call-template name="profil-img"/>
</nav>
</li>
</xsl:if>
<script type="text/javascript">
const closeUserMenuOnEscape = (event) => {
if (event.key === "Escape") {
var $openUserMenu = $j("header .icons .profil .dropdown.openAccessibility");
$openUserMenu.removeClass('openAccessibility');
$openUserMenu.prev().attr("aria-expanded", "false");
$openUserMenu.prev().focus();
}
}
function openUserMenuOnClick(el)
{
var isOpen = $j(el).next(".dropdown").is(':visible');
if(!isOpen) {
// Open menu
$j(el).next(".dropdown").addClass('openAccessibility');
$j(el).attr("aria-expanded", "true");
$j(el).next(".dropdown").find('ul > li a').first().focus();
$j(el).closest('li').get(0).addEventListener('keydown', closeUserMenuOnEscape);
} else {
// Close menu
$j(el).next(".dropdown").removeClass('openAccessibility');
$j(el).attr("aria-expanded", "false");
$j(el).closest('li').get(0).removeEventListener('keydown', closeUserMenuOnEscape);
}
}
$j(".icons ul li.profil").mouseenter(function (el) {
// Show user menu
var $dropdown = $j(this).find(".dropdown");
if (!$dropdown.is(':visible'))
{
$dropdown.addClass("openAccessibility");
$j(this).find('> button').attr("aria-expanded", true);
}
});
$j(".icons ul li.profil").mouseleave(function (el) {
// Hide user menu
var $dropdown = $j(this).find(".dropdown");
if ($dropdown.is(':visible'))
{
$dropdown.removeClass("openAccessibility");
$j(this).find('> button').attr("aria-expanded", false);
}
});
$j(document).ready(function() {
var _getAmetysUserCb = function(user)
{
if (user)
{
$j('.profil').show();
}
else
{
$j('.profil').hide();
}
}
getAmetysUser(_getAmetysUserCb);
});
</script>
</xsl:template>
Back" button management in the main menu in mobile mode
The positioning of the "Back" button has been revised to make it easier to navigate the main menu in mobile mode.
This change affects several XSL templates.
In the "menu-mobile" template, the call to the "menu-mobile-back" template has been removed. In addition, the role and aria-label attributes have been added.
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Dans le template "submenu-mobile-levels", les éléments <ul class="submenu"> deviennent des <div class="submenu"> contenant le <ul><li> de la liste des pages et un bouton "Retour"
Oops!
Copy to clipboard failed. Open the code and copy it manually.