Looking at the code it seems that you can generate only link breadcrumbs.
In some cases you will want a plain text crumb, typically the last one if it is the title of the current page.
Would it be possible to lookout for a special marker as the URL (in the Paths textarea) and if present then generate plain text (just the corresponding title, do not run through l function). For special marker maybe something like: "--" or "
".
As a less flexible alternative, you could provide a checkbox on the Custom Breadcrumb form to disable the link for the last crumb. Something like "Make last crumb plain text".
I can provide a patch if you think it is a good idea and would like to add this feature.
Comments
Comment #1
MGN commentedThis feature already exists. Try using the token
<none>for the path where you do not want a link.Comment #2
mariuss commentedNope, there is no such feature, just tried. At least not in 5.x-1.2.
I also searched the source code, no reference to "" at all.
Maybe a feature in 6.x?
Comment #3
MGN commentedLooks like it was added to DRUPAL-5 about two years ago (Commit #60360 by Eaton), but it was never released. I've just added a release node for 5.x-1.x, so the code should be availble within 12 hours. You can always get the latest code from cvs.
See http://drupal.org/cvs?commit=60360 for details.
Comment #4
mariuss commentedStill no dev build, or any other release, for 5. Can you please double check?
How about a 5.x-1.3?
Thanks
Comment #5
MGN commentedYeah. I have checked and for some reason, d.o. isn't publishing it. I am not sure why not, and am going to have to ask the webmasters whats going on...In the mean time, check it out from cvs. Sorry for the delay - not something I can control.
I don't want to release a new version number that hasn't been tested (in two years). Its better to have it tested as dev first, then released once its proven to be stable. Hope this makes sense.
Comment #6
MGN commentedOk. The system just packaged the 5.x-1.x-dev version. Can you give it a try and report if there are any problems. As far as I can tell, its been sitting for a couple of years...Thanks!
Comment #7
mariuss commentedThanks, seems to work.
A few minor issues:
1. Right after the update got this error: "user warning: Unknown column 'visibility_php' in 'field list' query: UPDATE custom_breadcrumb SET titles = '[title]', paths = 'node/[nid]', visibility_php = '', node_type = 'page' WHERE bid = 2 in /home/lohas/drupal5/core/includes/database.mysqli.inc on line 156."
Most likely this comes from update_1. At that point there is no visibility_php column yet.
2. On the Drupal Update result page, the message for update_1 is just one letter: "c".
3. For MySQL the new visibility_php column should be default '' and NOT NULL. It ends up the other way around. In update_2 revise the ALTER TABLE (maybe it was swapped with pgsql).
4. When editing a custom breadcrumb, under the "Paths" textarea, you may want to mention "< none >".
Comment #8
MGN commentedGreat. Thanks for looking into this. Would you be willing to write a patch that makes the changes you suggest? I can review the code but can't test it since I am just working on DRUPAL-6 now. So it would be better if someone else makes the patch....
Comment #9
mariuss commentedSee attached implementation. Not a patch, but the actual files.
Comment #10
MGN commentedI found a couple of problems with the changes in #9:
1. Can't renumber updates - see http://api.drupal.org/api/function/hook_update_N/5.
2. db_add_column is only to be used for Postgres, not mysql - see see http://api.drupal.org/api/function/hook_update_N/5.
Also there was another, related patch that was committed to 5.x-1.x-dev - #346113: PgSql Support
Otherwise I've made the changes recommended in #9.
I would appreciate it if someone could test the attached patch. Its against the latest 5.x-1.x-dev (updated on April 29th).
Comment #11
MGN commentedI am prepared to commit this but would like someone to test it first. Anyone willing to help on this?
Comment #12
MGN commentedChanging the status so perhaps someone will test this so it can be committed. Thanks.
Comment #13
MGN commentedCommitted to 5.x-1.x-dev for further testing.