You are here

public function Expert::defaultConfiguration in Display Suite 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/DsFieldTemplate/Expert.php \Drupal\ds\Plugin\DsFieldTemplate\Expert::defaultConfiguration()
  2. 8.2 src/Plugin/DsFieldTemplate/Expert.php \Drupal\ds\Plugin\DsFieldTemplate\Expert::defaultConfiguration()

Creates default configuration for the layout.

Return value

array Keyed array of default settings.

Overrides DsFieldTemplateBase::defaultConfiguration

File

src/Plugin/DsFieldTemplate/Expert.php, line 176

Class

Expert
Plugin for the expert field template.

Namespace

Drupal\ds\Plugin\DsFieldTemplate

Code

public function defaultConfiguration() {
  $config = [];
  $config['lb'] = '';
  $config['lb-col'] = \Drupal::config('ds.settings')
    ->get('ft-show-colon');
  $wrappers = [
    'lb' => [
      'title' => $this
        ->t('Label'),
    ],
    'lbw' => [
      'title' => $this
        ->t('Label wrapper'),
    ],
    'ow' => [
      'title' => $this
        ->t('Outer wrapper'),
    ],
    'fis' => [
      'title' => $this
        ->t('Field items'),
    ],
    'fi' => [
      'title' => $this
        ->t('Field item'),
    ],
  ];
  foreach ($wrappers as $wrapper_key => $value) {
    $config[$wrapper_key] = FALSE;
    $config[$wrapper_key . '-el'] = '';
    $config[$wrapper_key . '-at'] = '';
    $config[$wrapper_key . '-cl'] = '';
    $config[$wrapper_key . '-def-at'] = FALSE;
    $config[$wrapper_key . '-def-cl'] = FALSE;
  }
  return $config;
}