diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_body_row.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_body_row.html.twig
index cd8c44d0a5..1f6f74fd05 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_body_row.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_body_row.html.twig
@@ -1,3 +1,4 @@
+{% block empty_table_body_row %}
|
+{% endblock %}
diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_extra_actions.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_extra_actions.html.twig
index 99c2ce0b45..07c9146fd3 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_extra_actions.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/empty_table_extra_actions.html.twig
@@ -1,3 +1,4 @@
+{% block empty_table_extra_actions %}
+{% endblock %}
diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/table.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/table.html.twig
index 3e7d013cb0..3df7d4e441 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/table.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/table.html.twig
@@ -1,19 +1,11 @@
-{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
-
-{% set show_head_cols_if_empty = show_head_cols_if_empty|default(false) %}
-
-{% if is_last_column_sticky is not defined %}
- {% if body_rows is defined %}
- {% set no_action_cell_rows = body_rows|filter((row) => not (row.cols|last).has_action_btns|default(false)) %}
- {% set is_last_column_sticky = no_action_cell_rows|length == 0 %}
- {% else %}
- {% set is_last_column_sticky = false %}
- {% endif %}
-{% endif %}
+{% use '@ibexadesign/ui/component/table/table_body_row.html.twig' %}
+{% use '@ibexadesign/ui/component/table/table_head_row.html.twig' %}
+{% use '@ibexadesign/ui/component/table/table_header.html.twig' %}
+{% use '@ibexadesign/ui/component/table/empty_table_body_row.html.twig' %}
{% block header %}
{% if headline is defined %}
- {% include '@ibexadesign/ui/component/table/table_header.html.twig' with {
+ {% with {
headline,
actions: actions|default(null),
headline_title: headline_title|default(''),
@@ -21,7 +13,9 @@
notice_message: notice_message|default(''),
notice_icon: notice_icon|default('about-info'),
show_notice: show_notice|default(false),
- } only %}
+ } %}
+ {{ block('table_header') }}
+ {% endwith %}
{% endif %}
{% endblock %}
@@ -29,12 +23,25 @@
{% block table %}
{% set table_content %}
+ {% import "@ibexadesign/ui/component/macros.html.twig" as html %}
+ {% set show_head_cols_if_empty = show_head_cols_if_empty|default(false) %}
+ {% if is_last_column_sticky is not defined %}
+ {% if body_rows is defined %}
+ {% set no_action_cell_rows = body_rows|filter((row) => not (row.cols|last).has_action_btns|default(false)) %}
+ {% set is_last_column_sticky = no_action_cell_rows|length == 0 %}
+ {% else %}
+ {% set is_last_column_sticky = false %}
+ {% endif %}
+ {% endif %}
+
{% set empty_row %}
{% block tbody_empty %}
- {% include '@ibexadesign/ui/component/table/empty_table_body_row.html.twig' with {
+ {% with {
colspan: head_cols|length,
empty_image: empty_image|default(asset('/bundles/ibexaadminui/img/ibexa-empty-table.svg'))
} %}
+ {{ block('empty_table_body_row') }}
+ {% endwith %}
{% endblock %}
{% endset %}
@@ -48,42 +55,42 @@
{{ empty_row }}
- {% block thead %}
- {% if head_cols is defined %}
- {% include '@ibexadesign/ui/component/table/table_head_row.html.twig' with {
- head_cols,
- } %}
- {% endif %}
- {% endblock %}
+ {% block thead %}
+ {% if head_cols is defined %}
+ {{ block('table_head_row') }}
+ {% endif %}
+ {% endblock %}
- {% block tbody %}
+ {% block tbody %}
- {% if body_rows is defined %}
- {% if body_rows is empty %}
- {{ empty_row }}
- {% else %}
- {% block tbody_not_empty %}
- {% for row in body_rows %}
- {% include '@ibexadesign/ui/component/table/table_body_row.html.twig' with {
- body_row_cols: row.cols,
- class: row.class|default(''),
- attr: row.attr|default({}),
- } %}
- {% endfor %}
- {% endblock %}
- {% endif %}
+ {% if body_rows is defined %}
+ {% if body_rows is empty %}
+ {{ empty_row }}
+ {% else %}
+ {% block tbody_not_empty %}
+ {% for row in body_rows %}
+ {% with {
+ body_row_cols: row.cols,
+ class: row.class|default(''),
+ attr: row.attr|default({}),
+ } %}
+ {{ block('table_body_row') }}
+ {% endwith %}
+ {% endfor %}
+ {% endblock %}
{% endif %}
- {% endblock %}
+ {% endif %}
+ {% endblock %}
{% endset %}
- {% if is_scrollable is defined ? is_scrollable : true %}
+ {% if is_scrollable|default(true) %}
{{ table_content }}
diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_cell.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_cell.html.twig
index 45981792e5..26ff345520 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_cell.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_cell.html.twig
@@ -1,5 +1,5 @@
+{% block table_body_cell %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
-{% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}
{%- block action_btns_content -%}
+ {% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}
{{- table_macros.conditional_escape(content, raw|default(false)) -}}
{%- endblock -%}
@@ -23,3 +25,4 @@
{%- endif -%}
{%- endblock -%}
|
+{% endblock %}
diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_row.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_row.html.twig
index a770ad7ac0..e3950bb5a2 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_row.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/table_body_row.html.twig
@@ -1,3 +1,6 @@
+{% use '@ibexadesign/ui/component/table/table_body_cell.html.twig' %}
+
+{% block table_body_row %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
+{% endblock %}
diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/table_head_row.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/table_head_row.html.twig
index 3036e546a7..d70586acfd 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/table_head_row.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/table_head_row.html.twig
@@ -1,7 +1,10 @@
+{% use '@ibexadesign/ui/component/table/table_head_cell.html.twig' %}
+
+{% block table_head_row %}
{% block cells %}
{% for head_col in head_cols %}
- {% include '@ibexadesign/ui/component/table/table_head_cell.html.twig' with {
+ {% with {
has_checkbox: head_col.has_checkbox|default(false),
is_custom_bulk: head_col.is_custom_bulk|default(false),
has_icon: head_col.has_icon|default(false),
@@ -13,7 +16,10 @@
attr: head_col.attr|default({}),
wrapper_attr: head_col.wrapper_attr|default({}),
} %}
+ {{ block('table_head_cell') }}
+ {% endwith %}
{% set next_is_close_left = head_col.has_checkbox|default(false) or head_col.has_icon|default(false) %}
{% endfor %}
{% endblock %}
+{% endblock %}
diff --git a/src/bundle/Resources/views/themes/admin/ui/component/table/table_header.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/table/table_header.html.twig
index 04a35423a0..0b12775a23 100644
--- a/src/bundle/Resources/views/themes/admin/ui/component/table/table_header.html.twig
+++ b/src/bundle/Resources/views/themes/admin/ui/component/table/table_header.html.twig
@@ -1,3 +1,4 @@
+{% block table_header %}
+{% endblock %}