function EntityViewDisplayEditForm::buildExtraFieldRow

Same name in other branches
  1. 9 core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php \Drupal\field_ui\Form\EntityViewDisplayEditForm::buildExtraFieldRow()
  2. 8.9.x core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php \Drupal\field_ui\Form\EntityViewDisplayEditForm::buildExtraFieldRow()
  3. 11.x core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php \Drupal\field_ui\Form\EntityViewDisplayEditForm::buildExtraFieldRow()

Overrides EntityDisplayFormBase::buildExtraFieldRow

1 method overrides EntityViewDisplayEditForm::buildExtraFieldRow()
LayoutBuilderEntityViewDisplayForm::buildExtraFieldRow in core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php
Builds the table row structure for a single extra field.

File

core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php, line 73

Class

EntityViewDisplayEditForm
Edit form for the EntityViewDisplay entity type.

Namespace

Drupal\field_ui\Form

Code

protected function buildExtraFieldRow($field_id, $extra_field) {
    $extra_field_row = parent::buildExtraFieldRow($field_id, $extra_field);
    // Insert an empty placeholder for the label column.
    $label = [
        'empty_cell' => [
            '#markup' => ' ',
        ],
    ];
    $label_position = array_search('plugin', array_keys($extra_field_row));
    $extra_field_row = array_slice($extra_field_row, 0, $label_position, TRUE) + $label + array_slice($extra_field_row, $label_position, count($extra_field_row) - 1, TRUE);
    return $extra_field_row;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.