Closed (fixed)
Project:
Crumbs, the Breadcrumbs suite
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2010 at 04:57 UTC
Updated:
1 Feb 2011 at 22:25 UTC
I am currently working on a redesigned API (and refactoring the code on the way).
I will use this issue to document the most significant changes. I will do this in an issue comment, where I have edit access.
Comments
Comment #1
donquixote commentedNote: This issue is more a "note to self".
To anyone else: I do not expect anyone to make sense of my writing in this post. That said, if you are the lucky one who does, and you have an opinion, then please let me know!
---------------------
Major changes to the 1.x approach.
Clear distinction of $trail vs $breadcrumb.
Plugin objects and keys
hook_crumbs_plugins() instead of fancy class naming patterns.
The reason: Many modules need more than one plugin object, so in 1.x we ended up with a lot of static factory methods. Static methods are no better than floating functions, and classes should not be abused as namespaces. Thus, back to the good old Drupal hook.
findParent() and findTitle(), instead of decorateItem().
One-shot method hooks: decorateBreadcrumb() and preprocessPage().
Plugins: Multi-rule vs One-rule.
I will comment on this later ..
Goodbye to ItemWrapper.
get module_load_include() out of global scope.
Comment #2
donquixote commentedOpen questions / Unsolved problems
Default status for new crumbs plugins and rules?
When new modules are enabled, or menus or taxonomies created, that produce new crumbs plugins or rules, crumbs should do something useful, without the admin having to visit the crumbs configuration page each time.
For some plugins it will be reasonable to have them automatically enabled, as soon as they appear. Example: Forum, Organic Groups. For others we don't want that. Example: Node Reference - not every nodereference expresses a parent-child relationship.
We need a possibility in the define() method to express that a module should be disabled by default.
Link title (tooltip) ?
I don't think we will get tooltips ... Most of the core breadcrumbs don't have them either.
Comment #3
donquixote commentedWon't fix issues.
"change the path of a breadcrumb item".
(was requested in another issue)
This would be like changing the nid of a node. You just don't do that.
Whatever one wants to achieve with changing the path can be done in a different way.
support drupal_set_breadcrumb()
The problem: At the time that we want to build a crumbs trail, the breadcrumb set with drupal_set_breadcrumb() might not yet exist. This is especially true if some module calls crumbs_get_trail() in hook_init() for theme switching or other things. Thus, each module that calls drupal_set_breadcrumb() will need a crumbs plugin that replicates the behavior.
Sorry.
Comment #4
donquixote commented"needs review" = "probably fixed in 2.x"
Most of this is done in 2.x-dev.
Comment #5
donquixote commentedReopen if you miss anything.