Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3396526 by shagel, volkerk: Labels of input fields are missing #752

Open
wants to merge 14 commits into
base: 7.3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 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
10 changes: 5 additions & 5 deletions modules/thunder_paragraphs/css/paragraphs.widget.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* Subform */

/* Hide paragraphs field label in table header. */
.field--name-field-paragraphs .paragraphs-tabs-wrapper table.field-multiple-table:first-of-type th {
/* Set background in table header. */
.field--widget-paragraphs .paragraphs-tabs-wrapper table.field-multiple-table:first-of-type th {
background: var(--gin-bg-layer);
}
.field--name-field-paragraphs .paragraphs-tabs-wrapper table.field-multiple-table:first-of-type thead th.field-label h4 {
/* Hide paragraphs field label in table header. */
.field--widget-paragraphs table.field-multiple-table h4.paragraphs-table-header__label {
display: none;
}
/* Subform */
.paragraph-type--link .paragraphs-subform .field--name-field-link table.field-multiple-table:first-of-type thead {
display: none;
}
Expand Down
21 changes: 7 additions & 14 deletions modules/thunder_paragraphs/thunder_paragraphs.module
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,18 @@ function thunder_paragraphs_field_widget_third_party_settings_form(WidgetInterfa
}

/**
* Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
*
* Used for Classic Paragraphs widget.
* Implements hook_preprocess_HOOK() for field_multiple_value_form.
*/
function thunder_paragraphs_field_widgett_single_element_entity_reference_paragraphs_form_alter(array &$element, FormStateInterface $form_state, array $context): void {
thunder_paragraphs__attach_ief_submit(
$element,
[
'top',
'links',
'collapse_button',
]
);
function thunder_paragraphs_preprocess_field_multiple_value_form(array &$variables): void {
if (isset($variables['element']['#paragraphs_widget'])
&& $variables['element']['#paragraphs_widget'] === TRUE
&& isset($variables['table']['#header'][0]['data']['#attributes'])) {
$variables['table']['#header'][0]['data']['#attributes']->addClass('paragraphs-table-header__label');
}
}

/**
* Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
*
* Used for Experimental Paragraphs widget.
*/
function thunder_paragraphs_field_widget_single_element_paragraphs_form_alter(array &$element, FormStateInterface $form_state, array $context): void {
// Based on logic in ParagraphsWidget::formMultipleElements - execution of
Expand Down
Loading