Skip to content

Commit

Permalink
Close #3861 Change scope of spaceless filter from all elements to AZ …
Browse files Browse the repository at this point in the history
…Person headings (#3867)

Co-authored-by: Brian Berndt <[email protected]>
  • Loading branch information
trackleft and bberndt-uaz authored Nov 18, 2024
1 parent ea1f778 commit a5e2043
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
14 changes: 14 additions & 0 deletions modules/custom/az_person/az_person.module
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,17 @@ function az_person_preprocess_field(array &$variables) {
}
}
}

/**
* Implements hook_theme().
*/
function az_person_theme() {
$base_hook = [
'base hook' => 'field_group_html_element',
];
return [
'field_group_html_element__node__az_person__h1' => $base_hook,
'field_group_html_element__node__az_person__h2' => $base_hook,
'field_group_html_element__node__az_person__h3' => $base_hook,
];
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{#
/**
* @file
* Default theme implementation for a fieldgroup html element.
* Theme override for a fieldgroup html element.
*
* Available variables:
* - title: Title of the group.
* - title_element: Element to wrap the title.
* - children: The children of the group.
* - wrapper_element: The html element to use
* - wrapper_element: The html element to use.
* - attributes: A list of HTML attributes for the group wrapper.
*
* @see template_preprocess_field_group_html_element()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{#
/**
* @file
* Theme override for a fieldgroup html element.
*
* Available variables:
* - title: Title of the group.
* - title_element: Element to wrap the title.
* - children: The children of the group.
* - wrapper_element: The html element to use.
* - attributes: A list of HTML attributes for the group wrapper.
*
* @see template_preprocess_field_group_html_element()
*
* @ingroup themeable
*/
#}
<{{ wrapper_element }} {{ attributes }}>
{% if title %}
<{{ title_element }}{{ title_attributes }}>{{ title }}</{{ title_element }}>
{% endif %}
{% if collapsible %}
<div class="field-group-wrapper">
{% endif %}
{% apply spaceless %}{{children}}{% endapply %}
{% if collapsible %}
</div>
{% endif %}
</{{ wrapper_element }}>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{#
/**
* @file
* Theme override for a fieldgroup html element.
*
* Available variables:
* - title: Title of the group.
* - title_element: Element to wrap the title.
* - children: The children of the group.
* - wrapper_element: The html element to use.
* - attributes: A list of HTML attributes for the group wrapper.
*
* @see template_preprocess_field_group_html_element()
*
* @ingroup themeable
*/
#}
<{{ wrapper_element }} {{ attributes }}>
{% if title %}
<{{ title_element }}{{ title_attributes }}>{{ title }}</{{ title_element }}>
{% endif %}
{% if collapsible %}
<div class="field-group-wrapper">
{% endif %}
{% apply spaceless %}{{children}}{% endapply %}
{% if collapsible %}
</div>
{% endif %}
</{{ wrapper_element }}>

0 comments on commit a5e2043

Please sign in to comment.