You are here

public function HtmlFormatterTrait::getHtmlFormatterSettingsForm in HTML Formatter 8

Get form elements for the html formatter.

Return value

array $elements

4 calls to HtmlFormatterTrait::getHtmlFormatterSettingsForm()
HtmlFieldFormatter::settingsForm in src/Plugin/Field/FieldFormatter/HtmlFieldFormatter.php
Returns a form to configure settings for the formatter.
HtmlFieldFormatterDateTime::settingsForm in src/Plugin/Field/FieldFormatter/HtmlFieldFormatterDateTime.php
Returns a form to configure settings for the formatter.
HtmlFieldFormatterEntityReference::settingsForm in src/Plugin/Field/FieldFormatter/HtmlFieldFormatterEntityReference.php
Returns a form to configure settings for the formatter.
HtmlFieldFormatterTimestamp::settingsForm in src/Plugin/Field/FieldFormatter/HtmlFieldFormatterTimestamp.php
Returns a form to configure settings for the formatter.

File

src/Plugin/HtmlFormatterTrait.php, line 27

Class

HtmlFormatterTrait

Namespace

Drupal\html_formatter\Plugin

Code

public function getHtmlFormatterSettingsForm() {
  $elements = [];
  $elements['tag'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('HTML Tag'),
    '#default_value' => $this
      ->getSetting('tag'),
    '#min' => 1,
    '#description' => t('HTML tags like: h2, div, article, etc..'),
  ];
  $elements['class'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Class Name'),
    '#default_value' => $this
      ->getSetting('class'),
    '#min' => 1,
    '#description' => $this
      ->t('If left blank no class will be added.'),
  ];
  $elements['link'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Link to Content'),
    '#default_value' => $this
      ->getSetting('link'),
  ];
  return $elements;
}