Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

{% 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 } %}
{% set anchor_params = { items: grouped_fields|keys|map((label) => {
label,
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 %}
{% set default_form_templates = ibexa_admin_ui_config.contentEditFormTemplates %}
Expand Down Expand Up @@ -43,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