Skip to content

Commit

Permalink
lower all ids and id global prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Nov 13, 2023
1 parent eb02b64 commit 0d0f6db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

{% trans_default_domain 'content_edit' %}

{% set target_id_prefix = target_id_prefix|default('ibexa-edit-content-sections-content-fields-') %}
{% set grouped_fields = grouped_fields|default([]) %}
{% set anchor_params = { items: grouped_fields|keys|map((label) => {
label,
target_id: 'ibexa-edit-content-sections-content-fields-' ~ label|lower|slug }
target_id: target_id_prefix ~ label|lower|slug }
) } %}
{% set is_autosave_enabled = ibexa_user_settings['autosave'] is same as('enabled') %}
{% set form_has_autosave = form.autosave is defined %}
Expand Down Expand Up @@ -46,7 +47,7 @@
{% if grouped_fields|length > 1 %}
{% for key, group in grouped_fields %}
{% embed '@ibexadesign/ui/anchor_navigation_section.html.twig' with {
anchor_section_key: 'ibexa-edit-content-sections-content-fields-' ~ key|lower,
anchor_section_key: target_id_prefix ~ key,
} %}
{% trans_default_domain 'content_edit' %}
{% import '@ibexadesign/content/edit_macros.html.twig' as edit_macros %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ul class="ibexa-anchor-navigation-menu__sections ibexa-anchor-navigation-menu__sections--active">
{% for item in items %}
{% set item_label = item is iterable ? item.label : item %}
{% set sanitized_item = item is iterable and item.target_id is defined ? item.target_id : item_label|slug %}
{% set sanitized_item = item is iterable and item.target_id is defined ? item.target_id : item_label|lower|slug %}

<li class="ibexa-anchor-navigation-menu__sections-item">
<button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div
data-id="#{{ anchor_section_key|slug }}"
data-id="#{{ anchor_section_key|lower|slug }}"
class="ibexa-anchor-navigation__section {{ anchor_section_class|default('') }}"
>
{% block anchor_section_content %}
Expand Down

0 comments on commit 0d0f6db

Please sign in to comment.