How to add link titles to the breadcrumbs?

CommentFileSizeAuthor
#9 link-to-title.patch268 bytesshivam kaushal
#2 Title.png3.33 KBpaulocs

Comments

ab2211 created an issue. See original summary.

paulocs’s picture

StatusFileSize
new3.33 KB

Hello,
Do you mean title like image bellow?

Title

ab2211’s picture

No, I mean a title to the breadcrum link.

lamp5’s picture

Using hook_preprocess_breadcrumbs

paulocs’s picture

Oh yes, you can use the hook_preprocess_breadcrumbs like @lamp5 said. You can do this only programmatically using the custom_breadcrumb module.

I know that the easy_breadcrumb module has this possibility but I don't know if it is your case to use the easy_breadcrumb instead of the custom_breadcrumb.

ab2211’s picture

With the D7 version of custom breadcrumbs I had the possibility with a "| hreftitle" after the title.

paulocs’s picture

@ab2211 using the token module it is possible to get the page title.
Please install the token module and use the token -> [current-page:title]

Please tell us if it solves your problem.

shivam kaushal’s picture

Assigned: ab2211 » shivam kaushal
shivam kaushal’s picture

Assigned: shivam kaushal » Unassigned
StatusFileSize
new268 bytes

try this code , it will work

shivam kaushal’s picture

paulocs’s picture

Status: Active » Fixed

Setting issue to fixed.
Please feel free to reopen it if you have any question.

ab2211’s picture

Not sure, if I explained it correctly. I meant the title of the breacrumb link: <a href="abc" title="xyz">. WIth D7 I was able to do this, with the D8 version of the module this doesn't work.

paulocs’s picture

@ab2211, custom_breadcrumbs does not have this functionality.

paulocs’s picture

If you add a title variable to your template, you can use THEMENAME_preprocess_breadcrumb() to add the html title.

ab2211’s picture

Hm.

WIth D7 I use at title a vertical bar: My homepage | My Hompage is great and this makes <a href="/path/" title="My Hompage is great">My homepage </a>. This let's me customize the title wihout any tokens (I can use tokens too if needed).

So this will not be supported in further versions?

paulocs’s picture

You can open an issue as a "Feature request" and we can commit it when a patch is provided.
And then we make a release with this feature.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.