Add a field for text alignment

This commit is contained in:
Oliver Davies 2025-07-04 08:27:59 +01:00
parent fb3b58cf97
commit c816e90e06
7 changed files with 82 additions and 5 deletions

View file

@ -28,7 +28,13 @@
* @ingroup themeable
*/
#}
<div{{ attributes }}>
{% set text_alignment = content.field_text_alignment['#items'].getValue()|first.value %}
{% set classes = [
text_alignment is same as 'centre' ? 'flex justify-center',
] %}
<div{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if label %}
@ -38,6 +44,6 @@
{{ title_suffix }}
{% block content %}
{{ content }}
{{ content|without('field_text_alignment') }}
{% endblock %}
</div>