Hi, after playing a bit with crumbs module I've found a minor issue which could be fixed quite easily: links generated on the breadcrumb trail doesn't always have a "title" attribute set. It looks like only the latest item (usually the current page) has the "title" attribute.

Currently I've fixed this problem with a simple change on the buildBreadcrumb() function from BreadcrumbBuilder.php

I've changed the following line:

$item['link_options'] = array();

With:

$item['link_options'] = array('attributes'=>array('title'=>$title));

But this fix just suits my needs. Eventually this behavior could be improved adding an option or the use of tokens for the title attribute like "custom breadcrumb" module does.

What do you think about?

Thanks for the attention.

CommentFileSizeAuthor
#4 crumbs-add-title-attribute.patch429 bytesfinex

Comments

donquixote’s picture

Hi,
I thought about this as well.

As a first step, we could indeed just set the title itself as the title attribute.

The next step could be to use the description of the menu item, if there is a menu item for this breadcrumb.
Or the "description" of the router item set with hook_menu() (almost no module does this, afaik)

And then as a next step, every crumbs plugin could have an opinion what the description should be. This introduces a little problem, because the plugin that "wins" on the description might not be the same that "wins" on the title. Or the parent.

-----------

So, I'd say, as a quick fix, just implement the fix you mentioned.
Then a follow-up discussion for the more complex solution.

donquixote’s picture

Patch?
Prerferably on 7.x-2.x

donquixote’s picture

Version: 7.x-1.6 » 7.x-2.x-dev
finex’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new429 bytes

Hi, I've created a patch for the current -dev version.

finex’s picture

Hi, would be possible to include the patch on the module? Thanks :-)

donquixote’s picture

Title: Add "title" attribute on links » Add tooltip ("title" attribute) on links

Adding "tooltip" in the title for in-site and off-site SEO.