file BreadcrumbTitle.php

Namespace

Drupal\bootstrap\Plugin\Setting\Components\Breadcrumbs
  1. <?php
  2. namespace Drupal\bootstrap\Plugin\Setting\Components\Breadcrumbs;
  3. use Drupal\bootstrap\Plugin\Setting\SettingBase;
  4. use Drupal\bootstrap\Utility\Element;
  5. use Drupal\Core\Form\FormStateInterface;
  6. /**
  7. * The "breadcrumb_title" theme setting.
  8. *
  9. * @ingroup plugins_setting
  10. *
  11. * @BootstrapSetting(
  12. * id = "breadcrumb_title",
  13. * type = "checkbox",
  14. * title = @Translation("Show current page title at end"),
  15. * description = @Translation("If your site has a module dedicated to handling breadcrumbs already, ensure this setting is disabled."),
  16. * defaultValue = 1,
  17. * groups = {
  18. * "components" = @Translation("Components"),
  19. * "breadcrumbs" = @Translation("Breadcrumbs"),
  20. * },
  21. * )
  22. */
  23. class BreadcrumbTitle extends SettingBase {
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
  28. $setting = $this->getSettingElement($form, $form_state);
  29. $setting->setProperty('states', [
  30. 'invisible' => [
  31. ':input[name="breadcrumb"]' => ['value' => 0],
  32. ],
  33. ]);
  34. }
  35. }

Classes

Name Description
BreadcrumbTitle The "breadcrumb_title" theme setting.