If a breadcrumb title is too long or ugly, it can be replaced with an alias.
In the settings, the user can specify witch titles to replace with which aliases.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | easy_breadcrumb-replace_titles_with_aliases-2891840-24.patch | 3.22 KB | Caralin |
| #21 | easy_breadcrumb-replace_titles_with_aliases-2891840-21.patch | 3.59 KB | tatarbj |
| #11 | After(Admin).png | 79.65 KB | renatog |
| #11 | After.png | 49.4 KB | renatog |
| #11 | Before.png | 52.5 KB | renatog |
Comments
Comment #1
Schaklaggedehu commentedThe user writes the titles and their replacements like this: [Title:Replacement] separated by linebreaks.
Then the breadcrumb will show the replacement instead of the original title.
Schaklaggedehu created an issue. See original summary.
Comment #2
Schaklaggedehu commentedComment #3
tipit commentedIf null check in the form missing. Patch coming...
Comment #4
Schaklaggedehu commentedEmptycheck included.
Comment #5
Schaklaggedehu commentedComment #6
Schaklaggedehu commentedComment #7
greg boggsHey folks! Great Feature. The patch is rather large. Maybe there's some extra code polish?
Comment #8
Schaklaggedehu commentedYes, accidentally reformated the code. Cleaned up now.
Comment #9
greg boggsPerfect, thanks! Feel free to open a new issue for code formatting. Especially if I formatted it poorly.
Comment #10
greg boggsComment #11
renatog commentedHi people.
I applied the patch and works good for me.
Before:

After (Admin):

After:

Thank you very much for contributing.
Good Work.
Regards.
Comment #13
renatog commentedFixed.
Committed in the dev branch.
Thank you very much people.
Good Work.
Regards.
Comment #14
tatarbjHey guys,
i would change a small thing that makes sense when an original title has a : character, so i'm creating a new patch based on dev version with this, also changing the description.
Comment #15
tatarbjComment #16
tatarbjSo here is the patch for the change that will make sure a non-used string will be the one where we split up the titles.
Please review (same fix as a backport comes under https://www.drupal.org/node/2895974
Comment #17
tatarbjComment #18
renatog commentedHi there.
I applied the patch and Works good like a #2895974: Replace Breadcrumb titles with aliases
Thank you very much @tatarbj.
Regards.
Comment #19
revagomes commentedHere goes a updated patch with a refactoring to prevent warnings on array_key_exists() function calls when applying title aliases replacement rules.
Comment #20
revagomes commentedComment #21
tatarbjHi @revagomes,
that's super helpful and nice solution, but as you didn't use the previously RTBCed patch, let me fix yours and put them together to RTBC as i've tested your patch and it works well!
Bests,
Balazs.
Comment #22
Marcos Lehmkuhl commentedCool, I needed this patch and it's working.
Comment #23
Caralin commentedThe patch didn't apply against the latest dev for me any more.
I did a re-roll and had 2 conflicts in EasyBreadcrumbBuilder.php. The conflicts were in the handling of arrays (array() vs [] and array('-', '_') vs. ['-', '_'].
The patch worked fine when I tested it in a project.
Comment #24
greg boggsThanks Caralin!
Comment #25
Caralin commentedSpoke to soon. :(
Fixed the patch.
Comment #26
greg boggsI'll have tatarbj take a look. Thanks for the updated patch. Commit credit coming your way soon!
Comment #27
tatarbjDoing it right away
Comment #28
tatarbjOk folks, I think it's good enough to be committed to dev branch, nice work!
During the manual tests, I noticed this functionality is case sensitive as the whole breadcrumb logic changes the first letters to capital ones in the segments. As a new function got implemented in 7.x version, I'll open a follow-up issue to forward-port it to 8.x as it's a pretty nice solution to handle capitalization by the module with some edge cases - but for sure, it's not in the scope of this issue and i'm marking it RTBC!
@Greg as this is already released in 7.x, do you plan to release a new version with this for 8 or would you discuss some other things that could be forward-ported.
In the next 2 weeks i'll be more available then in drupalcon europe, where i'll be pretty limited as i'm going to Vienna - btw anyone of our active contributors comes too? We could meet there guys'n'girls :)
Bests,
Balazs.
Comment #29
greg boggsThanks @tarabj. I'll roll the release this week and spend the rest of it trying not to be jealous that you're going to Vienna. Oregon is on fire today. So, Vienna is sounding pretty amazing.
Comment #31
greg boggsHopefully I didn't muck this up. ;)