The current page title is not truncated when selecting "Truncate the page's title to a maximum number."

Created on 12 March 2021, over 3 years ago
Updated 6 November 2024, 9 days ago

Problem/Motivation

The current page title itself is not truncated when selecting "Truncate the page's title to a maximum number."

Also I would like to suggest a wording revision changing this to: "Truncate the page's title to a maximum length.". If this should be a separate issue let me know.

Steps to reproduce

* Enable the option "Truncate the page's title to a maximum number." and choose a short length with or without elipsis'.
* Also choose the option: "Include the current page as a segment in the breadcrumb"
* Create a node with a long title
* Note that the current page title is not shortened

Proposed resolution

Use the truncator function in the code segment below which seems to handle the current page title.

          elseif ($route_match->getRouteObject()) {
            $url = Url::fromRouteMatch($route_match);
            if ($this->config->get(EasyBreadcrumbConstants::ABSOLUTE_PATHS)) {
              $url->setOption('absolute', TRUE);
            }
            $links[] = new Link($title, $url);
          }

Remaining tasks

* Provide patch
* Update tests

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada lolcode

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom mike-kelly

    This wasn't working for me... the issue was that the truncation was not applied when using the current page title token in the breadcrumb.
    See attached patch for fix.

Production build 0.71.5 2024