Problem/Motivation

If I want to get the title of the current page so I can add it to a breadcrumb. I'm doing something like:

$title = \Drupal::service('title_resolver')->getTitle(\Drupal::request(), \Drupal::routeMatch()->getRouteObject());

This doesn't currently work for views pages?

This was done in D7 with drupal_get_title() - https://www.drupal.org/node/2067859

Proposed resolution

Add _title into the view display route.

Remaining tasks

Discuss if this is the right solution? Review, Tests

User interface changes

n/a

API changes

n/a

Data model changes

n/a

CommentFileSizeAuthor
views-title.patch634 bytesbenjy

Issue fork drupal-2594359

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

benjy created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, views-title.patch, failed testing.

benjy’s picture

Issue summary: View changes
dawehner’s picture

Status: Needs work » Closed (duplicate)

HLopes made their first commit to this issue’s fork.