Imagine the following situation, a website has a monthly magazine edition and a magazine has articles. An article node references a magazine edition.
Typically, in the breadcrumb on an article node you'd like something along these lines:

Home >> Magazine >> June Edition >> Article Title

The problem is that currently there's no easy way of adding "June Edition" in there. June Edition is the title of the magazine that the article references.

This patch attemps to fix that but needs 1 line of code extra, in hansel_ui.module we need to pass the parent ID to the rule which is being created. This lets me find out whether the selected parent rule has any node_reference fields which I can list in a drop down or, if none are present, show an error saying that there are not node references to follow.

The other fixes in hansel_ui.module are, in my opinion, slight changes that make for better code... it eliminates a drupal_goto in hansel_ui_rule_form_submit() and deals with rebuilding the form when errors are presented by letting it loop through multiple edit-next steps.

Check it out and see what you think. I know the dev version (something I was not aware of when starting the nodereference modification) provides a hook_hansel_get_parent() but still I think that easily linking to node references, without any custom code, might be a useful addition.

CommentFileSizeAuthor
#1 hansel-node_references-1645650.patch6.44 KBJeroen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jeroen’s picture

And here's the patch.