Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, It would be nice to to move the #header array to the module scope so we can use something like:
hook_form_search_api_index_fields_alter
eg:
/**
* Add search_api_glossary settings to Search API Index configuration.
*
* Implements hook_form_FORM_ID_alter().
*/
function search_api_glossary_form_search_api_index_fields_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
.
.
.
$form['entity:node']['#header'][] = t('Glossary AZ');
.
.
.
}
Comment | File | Size | Author |
---|---|---|---|
#2 | 2708639-patch.patch | 1.48 KB | dakku |
Comments
Comment #2
dakku CreditAttribution: dakku as a volunteer commentedComment #3
dakku CreditAttribution: dakku as a volunteer commentedComment #4
snufkin CreditAttribution: snufkin at Acquia commented+1 for this, I agree that the contents of the table header should be part of the data declaration, not the frontend layer.
Comment #5
borisson_Sure, why not?
Comment #7
drunken monkeyMy thoughts exactly.
Committed (with a bit of reformatting).
Thanks for the patch!