Skip to content

Commit

Permalink
Merge branch '5.17' into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidmattei committed Jun 10, 2024
2 parents 950f11d + 810f77f commit b1269c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion skeleton/template/structure/by_path.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
{% set currentStructure = structure.structure|default("[]")|ems_json_menu_nested_decode %}
{% else %}
{% set target = emsch_search_one('page', { "query": { "term": { ("#{locale}.slug") : (path) } } }) %}
{% set switchUrls = locales|filter(p => p != locale and attribute(source, p).slug is defined)|map(l => path('emsch_path', { 'path': attribute(source, l).slug, '_locale': l })) %}
{% endif %}

{% if target is defined %}
{% set source = target.source|default(null) %}
{% set switchUrls = ['nl', 'fr']|filter(p => p != locale and attribute(source, p).slug is defined)|map(l => path('emsch_path', { 'path': attribute(source, l).slug, '_locale': l })) %}
{% else %}
{% do emsch_http_error(404) %}
{% endif %}
Expand Down
6 changes: 1 addition & 5 deletions skeleton/template_ems/dashboard/sitemap.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'field_path': '[structure]',
'template': '@EMSCH/template_ems/dashboard/json_menu_nested.twig',
'context_block': 'build_context',
'active_item_id': app.request.get('activeItemId')|default(null),
'context': {
'sectionLabel': section._source.label,
'locale': locale
Expand Down Expand Up @@ -62,12 +63,7 @@
{% block ems_footer %}
<script>
window.addEventListener('emsReady', function () {
let url = new URL(window.location.href)
let activeItemId = url.searchParams.get('activeItemId');
Object.values(window.jsonMenuNestedComponents).forEach((jmn) => {
if (activeItemId) jmn.load({ activeItemId: activeItemId });
jmn.element.addEventListener('jmn-load', (event) => onJmnLoad(jmn, event));
jmn.element.addEventListener('jmn-add', (event) => onJmnAdd(jmn, event));
jmn.element.addEventListener('jmn-modal-custom', (event) => onJmnModalCustom(jmn, event));
Expand Down

0 comments on commit b1269c3

Please sign in to comment.