You are here

class EasyBreadcrumbConstants in Easy Breadcrumb 2.x

Same name and namespace in other branches
  1. 8 src/EasyBreadcrumbConstants.php \Drupal\easy_breadcrumb\EasyBreadcrumbConstants

EasyBreadcrumb module's contants.

Hierarchy

Expanded class hierarchy of EasyBreadcrumbConstants

4 files declare their use of EasyBreadcrumbConstants
EasyBreabcrumbConfigureTest.php in tests/src/Functional/EasyBreabcrumbConfigureTest.php
EasyBreadcrumbBuilderTest.php in tests/src/Kernel/EasyBreadcrumbBuilderTest.php
EasyBreadcrumbGeneralSettingsForm.php in src/Form/EasyBreadcrumbGeneralSettingsForm.php
easy_breadcrumb.install in ./easy_breadcrumb.install
Add installation messages to help users get started and update.

File

src/EasyBreadcrumbConstants.php, line 8

Namespace

Drupal\easy_breadcrumb
View source
class EasyBreadcrumbConstants {

  /**
   * Module's name.
   */
  const MODULE_NAME = 'easy_breadcrumb';

  /**
   * Module's settings.
   */
  const MODULE_SETTINGS = 'easy_breadcrumb.settings';

  /**
   * Flag for applying easy breadcrumb to admin routes.
   */
  const APPLIES_ADMIN_ROUTES = 'applies_admin_routes';

  /**
   * Flag for including invalid paths while generating the breadcrumb segments.
   */
  const INCLUDE_INVALID_PATHS = 'include_invalid_paths';

  /**
   * List of paths to be excluded from the generated segments.
   */
  const EXCLUDED_PATHS = 'excluded_paths';

  /**
   * List of titles to replace.
   */
  const REPLACED_TITLES = 'replaced_titles';

  /**
   * List of paths for custom breadcrumbs.
   */
  const CUSTOM_PATHS = 'custom_paths';

  /**
   * Separator between segments.
   */
  const SEGMENTS_SEPARATOR = 'segments_separator';

  /**
   * Flag for including or not the front page as a segment.
   */
  const INCLUDE_HOME_SEGMENT = 'include_home_segment';

  /**
   * Alternative title field for breadcrumbs.
   */
  const ALTERNATIVE_TITLE_FIELD = 'alternative_title_field';

  /**
   * Title for the front page segment.
   */
  const HOME_SEGMENT_TITLE = 'home_segment_title';

  /**
   * Flag for keeping the breadcrumb on the front page.
   */
  const HOME_SEGMENT_KEEP = 'home_segment_keep';

  /**
   * Flag for including or not the page's title as a segment.
   */
  const INCLUDE_TITLE_SEGMENT = 'include_title_segment';

  /**
   * Flag for printing the page's title as a link, or printing it as a text.
   */
  const TITLE_SEGMENT_AS_LINK = 'title_segment_as_link';

  /**
   * Use the page's title when it is available.
   */
  const TITLE_FROM_PAGE_WHEN_AVAILABLE = 'title_from_page_when_available';

  /**
   * Transformation mode to apply to the segments.
   */
  const CAPITALIZATOR_MODE = 'capitalizator_mode';

  /**
   * List of words to be ignored by the 'capitalizator'. E.g.: of and.
   */
  const CAPITALIZATOR_IGNORED_WORDS = 'capitalizator_ignored_words';

  /**
   * List of words to be forced by the 'capitalizator'. E.g.: your brand's name.
   */
  const CAPITALIZATOR_FORCED_WORDS = 'capitalizator_forced_words';

  /**
   * List of words to be forced by the 'capitalizator'. E.g.: your brand's name.
   */
  const CAPITALIZATOR_FORCED_WORDS_FIRST_LETTER = 'capitalizator_forced_words_first_letter';

  /**
   * Logical value to 'Make the first letters of each segment capitalized'.
   */
  const CAPITALIZATOR_FORCED_WORDS_CASE_SENSITIVITY = 'capitalizator_forced_words_case_sensitivity';

  /**
   * Flag for showing the language prefix as its own segment.
   */
  const LANGUAGE_PATH_PREFIX_AS_SEGMENT = 'language_path_prefix_as_segment';

  /**
   * Use menu title as fallback.
   */
  const USE_MENU_TITLE_AS_FALLBACK = 'use_menu_title_as_fallback';

  /**
   * Use page title as fallback for menu title.
   */
  const USE_PAGE_TITLE_AS_MENU_TITLE_FALLBACK = 'use_page_title_as_menu_title_fallback';

  /**
   * Use site title as the front page segment.
   */
  const USE_SITE_TITLE = 'use_site_title';

  /**
   * Flag for removing repeated identical segments from the breadcrumb.
   */
  const REMOVE_REPEATED_SEGMENTS = 'remove_repeated_segments';

  /**
   * Flag for storing absolute path settings.
   */
  const ABSOLUTE_PATHS = 'absolute_paths';

  /**
   * Flag for storing single home item settings.
   */
  const HIDE_SINGLE_HOME_ITEM = 'hide_single_home_item';

  /**
   * Flag for using term hierarchy.
   */
  const TERM_HIERARCHY = 'term_hierarchy';

  /**
   * Flag for adding the breadcrumb as structured to the HTML head.
   */
  const ADD_STRUCTURED_DATA_JSON_LD = 'add_structured_data_json_ld';

  /**
   * Follow redirects in case the redirect module is enabled.
   */
  const FOLLOW_REDIRECTS = 'follow_redirects';

  /**
   * Limit breadcrumb trail segments.
   */
  const LIMIT_SEGMENT_DISPLAY = 'limit_segment_display';

  /**
   * Breadcrumb segment count.
   */
  const SEGMENT_DISPLAY_LIMIT = 'segment_display_limit';

  /**
   * Breadcrumb truncator mode.
   */
  const TRUNCATOR_MODE = 'truncator_mode';

  /**
   * Breadcrumb truncator length.
   */
  const TRUNCATOR_LENGTH = 'truncator_length';

  /**
   * Breadcrumbs truncator dots.
   */
  const TRUNCATOR_DOTS = 'truncator_dots';

  /**
   * Default list of excluded paths.
   *
   * @return array
   *   Default list of ignored paths.
   */
  public static function defaultExcludedPaths() {
    static $default_excluded_paths = [
      'search',
      'search/node',
    ];
    return $default_excluded_paths;
  }

  /**
   * Default list of replaced titles.
   *
   * @return array
   *   Default list of replaced titles.
   */
  public static function defaultReplacedTitles() {
    return [];
  }

  /**
   * Default list of replaced paths.
   *
   * @return array
   *   Default list of replaced paths.
   */
  public static function defaultCustomPaths() {
    return [];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EasyBreadcrumbConstants::ABSOLUTE_PATHS constant Flag for storing absolute path settings.
EasyBreadcrumbConstants::ADD_STRUCTURED_DATA_JSON_LD constant Flag for adding the breadcrumb as structured to the HTML head.
EasyBreadcrumbConstants::ALTERNATIVE_TITLE_FIELD constant Alternative title field for breadcrumbs.
EasyBreadcrumbConstants::APPLIES_ADMIN_ROUTES constant Flag for applying easy breadcrumb to admin routes.
EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS constant List of words to be forced by the 'capitalizator'. E.g.: your brand's name.
EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS_CASE_SENSITIVITY constant Logical value to 'Make the first letters of each segment capitalized'.
EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS_FIRST_LETTER constant List of words to be forced by the 'capitalizator'. E.g.: your brand's name.
EasyBreadcrumbConstants::CAPITALIZATOR_IGNORED_WORDS constant List of words to be ignored by the 'capitalizator'. E.g.: of and.
EasyBreadcrumbConstants::CAPITALIZATOR_MODE constant Transformation mode to apply to the segments.
EasyBreadcrumbConstants::CUSTOM_PATHS constant List of paths for custom breadcrumbs.
EasyBreadcrumbConstants::defaultCustomPaths public static function Default list of replaced paths.
EasyBreadcrumbConstants::defaultExcludedPaths public static function Default list of excluded paths.
EasyBreadcrumbConstants::defaultReplacedTitles public static function Default list of replaced titles.
EasyBreadcrumbConstants::EXCLUDED_PATHS constant List of paths to be excluded from the generated segments.
EasyBreadcrumbConstants::FOLLOW_REDIRECTS constant Follow redirects in case the redirect module is enabled.
EasyBreadcrumbConstants::HIDE_SINGLE_HOME_ITEM constant Flag for storing single home item settings.
EasyBreadcrumbConstants::HOME_SEGMENT_KEEP constant Flag for keeping the breadcrumb on the front page.
EasyBreadcrumbConstants::HOME_SEGMENT_TITLE constant Title for the front page segment.
EasyBreadcrumbConstants::INCLUDE_HOME_SEGMENT constant Flag for including or not the front page as a segment.
EasyBreadcrumbConstants::INCLUDE_INVALID_PATHS constant Flag for including invalid paths while generating the breadcrumb segments.
EasyBreadcrumbConstants::INCLUDE_TITLE_SEGMENT constant Flag for including or not the page's title as a segment.
EasyBreadcrumbConstants::LANGUAGE_PATH_PREFIX_AS_SEGMENT constant Flag for showing the language prefix as its own segment.
EasyBreadcrumbConstants::LIMIT_SEGMENT_DISPLAY constant Limit breadcrumb trail segments.
EasyBreadcrumbConstants::MODULE_NAME constant Module's name.
EasyBreadcrumbConstants::MODULE_SETTINGS constant Module's settings.
EasyBreadcrumbConstants::REMOVE_REPEATED_SEGMENTS constant Flag for removing repeated identical segments from the breadcrumb.
EasyBreadcrumbConstants::REPLACED_TITLES constant List of titles to replace.
EasyBreadcrumbConstants::SEGMENTS_SEPARATOR constant Separator between segments.
EasyBreadcrumbConstants::SEGMENT_DISPLAY_LIMIT constant Breadcrumb segment count.
EasyBreadcrumbConstants::TERM_HIERARCHY constant Flag for using term hierarchy.
EasyBreadcrumbConstants::TITLE_FROM_PAGE_WHEN_AVAILABLE constant Use the page's title when it is available.
EasyBreadcrumbConstants::TITLE_SEGMENT_AS_LINK constant Flag for printing the page's title as a link, or printing it as a text.
EasyBreadcrumbConstants::TRUNCATOR_DOTS constant Breadcrumbs truncator dots.
EasyBreadcrumbConstants::TRUNCATOR_LENGTH constant Breadcrumb truncator length.
EasyBreadcrumbConstants::TRUNCATOR_MODE constant Breadcrumb truncator mode.
EasyBreadcrumbConstants::USE_MENU_TITLE_AS_FALLBACK constant Use menu title as fallback.
EasyBreadcrumbConstants::USE_PAGE_TITLE_AS_MENU_TITLE_FALLBACK constant Use page title as fallback for menu title.
EasyBreadcrumbConstants::USE_SITE_TITLE constant Use site title as the front page segment.