You are here

public function SitemapBase::settingsForm in Sitemap 8.2

Same name and namespace in other branches
  1. 2.0.x src/SitemapBase.php \Drupal\sitemap\SitemapBase::settingsForm()

Returns a form to configure settings for the mapping.

Parameters

array $form: The form where the settings form is being included in.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form elements for the sitemap_map's settings.

Overrides SitemapInterface::settingsForm

4 calls to SitemapBase::settingsForm()
Book::settingsForm in src/Plugin/Sitemap/Book.php
Returns a form to configure settings for the mapping.
Frontpage::settingsForm in src/Plugin/Sitemap/Frontpage.php
Returns a form to configure settings for the mapping.
Menu::settingsForm in src/Plugin/Sitemap/Menu.php
Returns a form to configure settings for the mapping.
Vocabulary::settingsForm in src/Plugin/Sitemap/Vocabulary.php
Returns a form to configure settings for the mapping.
4 methods override SitemapBase::settingsForm()
Book::settingsForm in src/Plugin/Sitemap/Book.php
Returns a form to configure settings for the mapping.
Frontpage::settingsForm in src/Plugin/Sitemap/Frontpage.php
Returns a form to configure settings for the mapping.
Menu::settingsForm in src/Plugin/Sitemap/Menu.php
Returns a form to configure settings for the mapping.
Vocabulary::settingsForm in src/Plugin/Sitemap/Vocabulary.php
Returns a form to configure settings for the mapping.

File

src/SitemapBase.php, line 89

Class

SitemapBase
Base class for Sitemap plugin implementations.

Namespace

Drupal\sitemap

Code

public function settingsForm(array $form, FormStateInterface $form_state) {

  // Provide a section title field for every mapping plugin.
  $form['title'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Title'),
    '#default_value' => $this->settings['title'],
    '#description' => $this
      ->t('If you do not wish to display a title, leave this field blank.'),
    '#weight' => -10,
  ];
  return $form;
}