Skip to content

Commit

Permalink
AV-2092: Add faq menus for en and sv
Browse files Browse the repository at this point in the history
  • Loading branch information
eetumans committed Nov 9, 2023
1 parent 547c6fc commit 6e9d68c
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ third_party_settings:
- operating-model-menu-en
- operating-model-menu-fi
- operating-model-menu-sv
- faq-menu-en
- faq-menu-fi
- faq-menu-sv
parent: 'guide-menu-fi:'
_core:
default_config_hash: TJ9-xPK8xacrOKUra0l2-DrLJz6nZO7nnq68pl_lT5E
Expand All @@ -27,4 +30,4 @@ description: 'A content type that can be used for writing a new page to the guid
help: ''
new_revision: true
preview_mode: 1
display_submitted: false
display_submitted: false
10 changes: 10 additions & 0 deletions drupal/modules/avoindata-theme/avoindata.theme
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,20 @@ function avoindata_preprocess_block(&$variables) {
'class' => '',
'menucounter' => true,
],
'faqmenuen' => [
'href' => '/en/faq',
'class' => '',
'menucounter' => false,
],
'faqmenufi' => [
'href' => '/fi/ukk',
'class' => '',
'menucounter' => false,
],
'faqmenusv' => [
'href' => '/sv/vanliga-fragor',
'class' => '',
'menucounter' => false,
]
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
langcode: en
status: true
dependencies:
config:
- system.menu.faq-menu-en
module:
- language
- node
- system
theme:
- avoindata
id: faqmenuen
theme: avoindata
region: guide_menu
weight: 0
provider: null
plugin: 'system_menu_block:faq-menu-en'
settings:
id: 'system_menu_block:faq-menu-en'
label: Frequently Asked Questions
label_display: visible
provider: system
level: 1
depth: 0
expand_all_items: false
visibility:
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
avoindata_guide_page: avoindata_guide_page
language:
id: language
negate: false
context_mapping:
language: '@language.current_language_context:language_interface'
langcodes:
en: en
request_path:
id: request_path
negate: false
pages: "/faq\r\n/faq/*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
langcode: sv
status: true
dependencies:
config:
- system.menu.faq-menu-sv
module:
- language
- node
- system
theme:
- avoindata
id: faqmenusv
theme: avoindata
region: guide_menu
weight: 0
provider: null
plugin: 'system_menu_block:faq-menu-sv'
settings:
id: 'system_menu_block:faq-menu-sv'
label: Vanliga frågor
label_display: visible
provider: system
level: 1
depth: 0
expand_all_items: false
visibility:
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
avoindata_guide_page: avoindata_guide_page
language:
id: language
negate: false
context_mapping:
language: '@language.current_language_context:language_interface'
langcodes:
sv: sv
request_path:
id: request_path
negate: false
pages: "/vanliga-fragor\r\n/vanliga-fragor/*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: faq-menu-en
label: 'Faq menu (en)'
description: 'Menu for faq page (en)'
locked: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: sv
status: true
dependencies: { }
id: faq-menu-sv
label: 'Faq menu (sv)'
description: 'Menu for faq page (sv)'
locked: false
8 changes: 6 additions & 2 deletions drupal/modules/avoindata-theme/js/cycle_guide_menu_items.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class MenuUtils {
'block-operatingmodelmenuen-menu',
'block-operatingmodelmenufi-menu',
'block-operatingmodelmenusv-menu',
'block-faqmenufi-menu'
'block-faqmenuen-menu',
'block-faqmenufi-menu',
'block-faqmenusv-menu'
]

this.menuLinkSelectors = [
Expand All @@ -44,7 +46,9 @@ class MenuUtils {
'block-operatingmodelmenuen',
'block-operatingmodelmenufi',
'block-operatingmodelmenusv',
'block-faqmenufi'
'block-faqmenuen',
'block-faqmenufi',
'block-faqmenusv'
]

this.menu = this.getMenu();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include "guide-menu-template.html.twig" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include "guide-menu-template.html.twig" %}

0 comments on commit 6e9d68c

Please sign in to comment.