In Drupal, local tasks are shown as part of their parent: the main page title is still the one of the parent (e.g. "Administer"), while the selected tab is only present in the page, under the <h1> tag.

This can be confusing, for example when you have multiple local tasks open in separate browser windows/tabs. They will all have the same title and will be impossible to tell apart that way.

In the page, the local tasks are shown as part of the page heading, and the title in the <HEAD> <TITLE> tags should reflect that. For example, if you go to /admin/by-module, the head title should be "Administer › By Module" (Garland themes in the funky arrow). At /admin/user and /admin/user/user, it should be "Users › List". /admin/user/add would be "Users › Add". So, even default local tasks would show their title in the head.

The attached patch implements this cleanly. The head breadcrumb is themed the same as the one in the page, but without HTML tags.

The only exception is when drupal_set_title() is used to override the page title. This happens e.g. on user/123. The menu item is defined for 'user' and has a generic 'user' title. When it is viewed, the title is changed to the account name. In this case, we cannot generate a breadcrumb for the local tasks, as it would simply say "User › View" and "User › Edit".

CommentFileSizeAuthor
breadcrumb-title.patch2.72 KBSteven

Comments

merlinofchaos’s picture

I offer a tentative +1 on this patch. I need to install it and make sure it does what it appears to do, but from my read of the code it looks good.

One immediate comment I have though -- on at least one site, I have my phptemplate_breadcrumb actually embedding HTML and doing a few other things. Just doing a straight theme('breadcrumb') is going to cause this to act really strange. There may need to be some kind of context identifier to theme breadcrumb -- or perhaps an entirely new theme that's just for the head title. After all, in phptemplate.engine the head title is constructed from the title as well as the site name -- perhaps theme_head_title could be built to pull that out of phptemplate.engine entirely, add the site name in, and unify that?

keith.smith’s picture

Status: Needs review » Needs work

patch no longer applies

# patch -p0 < breadcrumb-title.patch
patching file includes/menu.inc
Hunk #1 FAILED at 227.
1 out of 1 hunk FAILED -- saving rejects to file includes/menu.inc.rej
patching file includes/path.inc
Hunk #1 succeeded at 176 (offset 15 lines).
patching file themes/engines/phptemplate/phptemplate.engine
Hunk #1 FAILED at 186.
1 out of 1 hunk FAILED -- saving rejects to file themes/engines/phptemplate/phptemplate.engine.rej

chrisshattuck’s picture

Great patch, almost exactly what I was looking for. It would be nice to have the option to display the breadcrumbs in the heading as well (i.e. between the h1 tags).

In regards to the problem mentioned above, the phptemplate.engine file is in a different folder than the other two files. You can either run the patch in both the includes/ and themes/engines/phptemplate/ folders, or you can copy phptemplate.php over to the includes folder, run the patch, and then cut and paste it back into it's original folder.

pancho’s picture

Version: 6.x-dev » 7.x-dev

Moving feature requests to D7 queue. Sorry...

mfer’s picture

Subscribing. This looks good for usability. Have to follow up in this in D7.

Jaza’s picture

Version: 7.x-dev » 8.x-dev

Moving.

sun’s picture

Although I understand the idea, I don't think the consequences of it would be an improvement.

Right now, your browser window/tab title shows the title of the page you're on -- at least the beginning of it.

With this patch, and e.g., 5 open tabs on admin pages, all you'd see would be "Administration » ...", "Administration » ...", "Administration » ...", "Administration » ...", etc

Furthermore, we'd need a special builder/theme function, as the regular theme_breadcrumb() returns HTML markup and is often overridden/customized by the theme.

IMHO, won't fix.

sun’s picture

Title: Add breadcrumb for local tasks to <HEAD> title » Output title of current local task in HEAD title (e.g., "People » List")

Sorry, turns out I did not understand the idea. Trying to prevent this for others with a better issue title.

sun’s picture

Discussed with @merlinofchaos in IRC.

Very closely related: #996302-3: Pages of local actions don't display local action title as page title basically suggests to also output this info in the page title, not only in the HEAD title. Looks like a nice target for the usability team.

Bojhan’s picture

Issue tags: -Needs usability review

ah

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Since there hasn't been movement in 12 years think it's safe to say this can be closed.

If still a valid request please reopen updating issue summary for how it pertains to D10.