Make title/path fields not required
nicholasThompson - December 10, 2008 - 10:48
| Project: | Custom Breadcrumbs |
| Version: | 6.x-2.x-dev |
| Component: | custom_breadcrumbs |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
By making them required you are FORCING the user to have the breadcrumb to be at least 2 levels, eg Home > blog.
For my situation, I didn't want the 2nd link for all my blog posts - I simply wanted the breadcrumbs to be "Home" but couldn't do this with your module due to the required field settings.
By removeing the required parts of the form, I get the desired results and there appears to be no ill side-effects...
| Attachment | Size |
|---|---|
| custom_breadcrumbs.admin_.inc_.patch | 1.03 KB |

#1
Interesting application - a custom breadcrumb to produce an empty breadcrumb! I guess this qualifies as custom, but I don't think this patch is the way to do it. Requiring that the title and path be filled in on the form is more user friendly, making sure it wasn't omitted on accident. Normal use of the module supports '#required => TRUE', so I wouldn't change that.
If you want to omit the breadcrumb title, you should have to explicitly ask for it, just as you do with the path. This is possible with the identifier
'<none>'. I think the same identifier should be allowed for the title to cover this case - enter<none>in the title block if you don't want a title. It's still a one-line patch in custom_breadcrumbs_nodeapi() (custom_breadcrumbs.module).I haven't tested this patch, but I've tried the equivalent on my (heavily patched) version of cb and it works fine. Note that the documentation on the form should also be changed so its clear that
<none>is a valid identifier (as is done in the patch supplied by dbabbage in #296516: Clean path using pathauto function). Where to put the documentation depends on whether or not that patch is committed....#2
The current version 6.x-1.x-dev now has this (using the identifier
<none>), and it is documented in the new README.txt file. Thanks.#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
Setting Titles and Paths to
<none>outputs an unnecessary breadcrumb separator:Home > > Node Title
Instead, it should be
Home > Node Title
Is this a bug or was it just not tested yet?
#5
Interesting. I don't think it was ever tested.
I would wonder why an administrator would bother setting both titles and paths to
<none>?Is there a use-case that we should be considering here?
What would the administrator be trying to accomplish with this kind of breadcrumb construction?
I am not sure its a bug. Is it worthwhile trying to avoid this type of "error"?
#6
#7
The admin might be trying to reduce the level of breadcrumbs. e.g.:
Home > Blog Entry
instead of
Home > Blog > Blog Entry
#8
Yes, but this could be accomplished by simply omitting the second rather, rather than putting in
<none>for both the path and the title.#9
I am closing this issue since its migrated away from the original issue and I am not sure I see the need to prevent the admin from doing this. If you would like to pursue it further, just open a new issue. Thanks.