Skip to content
Snippets Groups Projects
Commit 770f7795 authored by katja's avatar katja
Browse files

use label for University main menu from drupal settings

parent abad7ac0
No related branches found
No related tags found
No related merge requests found
......@@ -633,6 +633,7 @@ export namespace Components {
isMobile: boolean;
logoLabel?: string;
logoUrl?: string;
menuLabel: string;
siteLabel?: string;
siteUrl?: string;
}
......@@ -2019,6 +2020,7 @@ declare namespace LocalJSX {
isMobile?: boolean;
logoLabel?: string;
logoUrl?: string;
menuLabel?: string;
onMobileMenuTopToggle?: (event: CustomEvent<any>) => void;
onUniversityMainMenuToggled?: (event: CustomEvent<any>) => void;
siteLabel?: string;
......
......@@ -23,6 +23,7 @@ let keys = {
})
export class HyMenuMainGroup {
@Element() el: HTMLElement;
@Prop() menuLabel: string = 'University main menu';
@Prop() dataMainMenu: MainMenu[] | string;
@Prop() isMobile: boolean = false;
@Prop() logoUrl?: string;
......@@ -211,7 +212,7 @@ export class HyMenuMainGroup {
) : (
<hy-icon class={'toggle__caret'} icon={'hy-icon-slim-hamburger-menu'} size={8} fill={white} />
)}
<span>University main menu</span>
<span>{this.menuLabel}</span>
</button>
<div
class={{
......
......@@ -4,15 +4,16 @@
## Properties
| Property | Attribute | Description | Type | Default |
| -------------- | ---------------- | ----------- | ---------------------- | ----------- |
| `dataMainMenu` | `data-main-menu` | | `MainMenu[] \| string` | `undefined` |
| `donate` | -- | | `DonateLink[]` | `undefined` |
| `isMobile` | `is-mobile` | | `boolean` | `false` |
| `logoLabel` | `logo-label` | | `string` | `undefined` |
| `logoUrl` | `logo-url` | | `string` | `undefined` |
| `siteLabel` | `site-label` | | `string` | `undefined` |
| `siteUrl` | `site-url` | | `string` | `undefined` |
| Property | Attribute | Description | Type | Default |
| -------------- | ---------------- | ----------- | ---------------------- | ------------------------ |
| `dataMainMenu` | `data-main-menu` | | `MainMenu[] \| string` | `undefined` |
| `donate` | -- | | `DonateLink[]` | `undefined` |
| `isMobile` | `is-mobile` | | `boolean` | `false` |
| `logoLabel` | `logo-label` | | `string` | `undefined` |
| `logoUrl` | `logo-url` | | `string` | `undefined` |
| `menuLabel` | `menu-label` | | `string` | `'University main menu'` |
| `siteLabel` | `site-label` | | `string` | `undefined` |
| `siteUrl` | `site-url` | | `string` | `undefined` |
## Events
......
......@@ -58,6 +58,7 @@ export class SiteHeader {
private donateLink: DonateLink[];
private menuLabels: ComponentLabels[];
private searchLabels: ComponentLabels[];
private groupPages: ComponentLabels[];
private languageLabels: ComponentLabels[];
@State() lastScrollTop = 0;
......@@ -107,6 +108,7 @@ export class SiteHeader {
this.menuLabels = labels.menu_labels;
this.languageLabels = labels.language_labels;
this.searchLabels = labels.search_labels;
this.groupPages = labels.group_pages;
this.el.children[0].setAttribute('menu-button-breadcrumb-home', this.menuLabels['home']);
this.el.children[0].setAttribute('menu-button-breadcrumb-main', this.menuLabels['main']);
......@@ -244,7 +246,12 @@ export class SiteHeader {
url={this.siteUrl}
label={this.siteLabel}
/>
<hy-menu-main-group tabindex="0" is-mobile={false} data-main-menu={this.dataMainMenuLinks} />
<hy-menu-main-group
tabindex="0"
is-mobile={false}
menu-label={this.groupPages['university_main_menu'] ?? null}
data-main-menu={this.dataMainMenuLinks}
/>
</div>
<div class={'menu--secondary menu--secondary--group'}>
......@@ -334,7 +341,11 @@ export class SiteHeader {
url={this.siteUrl}
label={this.siteLabel}
/>
<hy-menu-main-group is-mobile={false} data-main-menu={this.dataMainMenuLinks} />
<hy-menu-main-group
is-mobile={false}
menu-label={this.groupPages['university_main_menu'] ?? ''}
data-main-menu={this.dataMainMenuLinks}
/>
</div>
<div class={'menu--secondary menu--secondary--group'}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment