You are here

public static function HtmlElement::defaultContextSettings in Field Group 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php \Drupal\field_group\Plugin\field_group\FieldGroupFormatter\HtmlElement::defaultContextSettings()

Defines the default settings for this plugin.

Parameters

string $context: The context to get the default settings for.

Return value

array A list of default settings, keyed by the setting name.

Overrides FieldGroupFormatterBase::defaultContextSettings

File

src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php, line 202

Class

HtmlElement
Plugin implementation of the 'html_element' formatter.

Namespace

Drupal\field_group\Plugin\field_group\FieldGroupFormatter

Code

public static function defaultContextSettings($context) {
  $defaults = array(
    'element' => 'div',
    'show_label' => 0,
    'label_element' => 'h3',
    'effect' => 'none',
    'speed' => 'fast',
    'attributes' => '',
  ) + parent::defaultSettings($context);
  if ($context == 'form') {
    $defaults['required_fields'] = 1;
  }
  return $defaults;
}