There are quite a few breadcrumb modules out there, so it is legitimate to wonder why on earth it would be a good idea to write a new module to handle breadcrumbs within Page Manager. This is why I eventually decided on doing just this in a project I'm working on:
- The most flexible breadcrumbs modules (such as Custom Breadcrumbs 2) does not support configuration export, which was crucial for the project at hand.
- The only exportable breadcrumbs modules I found supports breadcrumbs only for certain path types (such as for nodes).
- I really like the concepts of Page Manager and Panels.
Ideally, I would like to have Page Manager have a section where you can enter plugin-enabled actions – but I have so far not found a way of adding a CTools plugin at that level (this being my first CTool plugin ever). Instead I have used the access rules to write an action that sets a breadcrumb without affecting the actual access outcome.
It would be much neater (and less of a hack) if this could be run as a clean action, not expected to change access/variant selection/visibility rules.
Does anyone know if it is possible to add plugins on this level? What I'm after is basically a new tab, like the access or menu, and also subtask like selection rule or context.
I've gotten as far as the page_manager_page_build_subtask function, but can't see how it could be hooked into. If someone with more experience in the CTools framework could give me a nudge in the right direction it would be much appreciated.
If anyone is interested in the breadcrumb code, it is attached below.
Cheers!
//Johan Falk, NodeOne, Sweden
| Attachment | Size |
|---|---|
| pm_breadcrumb.zip_.txt | 3.68 KB |

Comments
No.
A discussion with fabsor, with quite some experience with CTools, provided me with a clear answer to the question above: "No."
It is not possible to add plugins at that level, with less than patching Page Manager.
//Johan Falk, NodeOne, Sweden
Actually... There is a way.
Actually...
There is a way. Panels Everywhere uses it to add a 'Template' tab to variants to let them directly control which panels everywhere tab.
See page_manager.admin.inc and look for this:
<?phpdrupal_alter('page_manager_variant_operations', $operations[$id], $handler);
?>
Yay!
I will look into this. And most definately have a serious talk with fabsor. :-)
Thanks!
//Falk
It is something that has not
It is something that has not yet been documented and is a relatively new feature.
Hey Johan, Nice meeting you
Hey Johan,
Nice meeting you at Drupal Con Chicago with chx,jhogdon and others at the boardgame bof. Anyways any update on this? Also with your permission I would like to further look into this and see if this fits with panels_extras http://www.drupal.org/project/panels_extras .
Nice meeting you too!
Feel free to take this project/idea further, by any means.
I discussed it very briefly with Fago, and he pointed out that it would probably be easy to add an event listener for evey custom page or page variant – to allow Rules to react when pages are viewed.
Running full actions would be better, because it could allow loading new objects into Panels – allowing not only things like setting breadcrumbs but also loading new objects. (The only objects that can be used for access control right now are the ones included in path arguments.)
I made at stab at including Rules actions in Page manager here at DrupalCon, but I basically didn't get anywhere at all. :-/
Please write back if you make any progress!
//Johan Falk, NodeOne, Sweden
This aproach looks really great
There's project application that waits http://groups.drupal.org/node/181694 which uses this hook.
This makes breadcrubms as part of exportable page and I like this!
The application was successful!
You can now find it at it's own page http://drupal.org/project/panels_breadcrumbs