buildExtraFieldRow example

$plugin_type_info = $plugin->getPluginDefinition();
      $field_row['plugin']['settings_edit_form']['label']['#markup'] = $this->t('Format settings:') . ' <span class="plugin-name">' . $plugin_type_info['label'] . '</span>';
    }

    return $field_row;
  }

  /** * {@inheritdoc} */
  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' => '&nbsp;',
      ],
    ];
    $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_positioncount($extra_field_row) - 1, TRUE);

    return $extra_field_row;
  }
return parent::buildFieldRow($field_definition$form$form_state);
  }

  /** * {@inheritdoc} */
  protected function buildExtraFieldRow($field_id$extra_field) {
    if ($this->entity->isLayoutBuilderEnabled()) {
      return [];
    }

    return parent::buildExtraFieldRow($field_id$extra_field);
  }

}

      ],
    ];

    // Field rows.     foreach ($field_definitions as $field_name => $field_definition) {
      $table[$field_name] = $this->buildFieldRow($field_definition$form$form_state);
    }

    // Non-field elements.     foreach ($extra_fields as $field_id => $extra_field) {
      $table[$field_id] = $this->buildExtraFieldRow($field_id$extra_field);
    }

    $form['fields'] = $table;

    // Custom display settings.     if ($this->entity->getMode() == 'default') {
      // Only show the settings if there is at least one custom display mode.       $display_mode_options = $this->getDisplayModeOptions();
      // Unset default option.       unset($display_mode_options['default']);
      if ($display_mode_options) {
        
Home | Imprint | This part of the site doesn't use cookies.