Hi, I have the following rules set:
start
switch on url argument 1
- corporation
- add link Home
- switch on url argument 2
-- corporation/info
-- add link Corporation
-- leave
What I found strange is that in the path www.example.com/corporation the rule works perfect. It shows the breadcrumb "Home", but in the path www.example.com/corporation/info it says that node/X path will be used and doesn't match the rules. Why for the first argument the alias is working and not for the second? Is there anyway to make all the nodes which url starts with www.example.com/corporation/ have a determined breadcrumb?
Thank you very much. I think this module will be a "must have" if Drupal breadcrumb system doesn't change completely
Comments
Comment #1
mauritsl commentedI assume that /corporation is not a node page, but a page from a module (like views).
When the pages on /corporation/* are page nodes (likely to be used in other sections as well) you can now only go on with switching on node id's and add a rule per node. That's not a very friendly way of cause, an easier way would be desired, but is difficult. I am willing to add this to Hansel, but need a clever solution for that. There are a few options:
1) A switch which matches a rule when the alias starts with the rule name (your suggestion)
In this case you can have a configuration like:
But what if we want to add the subpages to the breadcrumbs as well? We can extend the configuration to:
But that will generate the breadcrumbs "Corporation > Corporation" for /corporation (cause it always adds the link to the page). So this also needs a switch to determine that a given url argument is not empty. You can now do that with the url argument switch when enabling regular expressions and set the name to ".+", but that's a bit complicated. Implementing "<empty>" makes more sense. That makes a configuration possible like:
That works for /corporation and /corporation/info (or something other that "info"), but not for the 3rd sublevel; /corporation/info/address
2) Another option may be a breadcrumb action like "add menu path", which adds crumbs from the menupath, similar to the regular Drupal breadcrumbs. Maybe this is a good way to go, when some configuration options are provided (to skip the root menu-item, for example). That can be handy for sections which have all pages inside the menu structure.
Making your use case easier to configure requires a more difficult concept than expected. I would be great to have a few troughs on this before I start coding.
Comment #2
enkara commentedI don't know if I understand properly the problem. You have been working on this for so many days and I just discovered the module, but here there are my thoughts:
I would implement a new switch called url alias argument. It simply would do the same as the url argument but working with the url alias. Then maybe it would be helpful to have and to say what has to be done if another argument is empty and also to cover all the subpages of the next level.
If I'm totally wrong in the concept just don't mind me.
Comment #3
mauritsl commentedThe solution is more complex than just a switch on alias. But you are not totally wrong, it works for subpages, but not for subs from subs.
However, I agree that a switch on alias would be helpful for now. I am going to implement this very soon, together with <empty> (explained above).
I will update this ticket if this is in the dev snapshot. I do not plan to create an official release for this, but the dev snapshot works really well.
Comment #4
enkara commentedOk, don't worry I have no hurry on this.
It's very kind of your part to try to solve users problems :)
Thank you!
Comment #5
bertboerland commentedand thank you for your great quote "I think this module will be a "must have" if Drupal breadcrumb system doesn't change completely" :-)
Comment #6
mauritsl commentedA switch on path alias and support for <empty> in url argument switch have been committed to CVS and will be available in the dev snapshot soon.
Comment #7
bertboerland commentedthanks mau!
Comment #8
enkara commented:) Thanks I'll have it a try!