This use case has now come up twice with different clients of mine:
They are using autocomplete to select a node. They choose a node and would like to edit the title so that the link to the node is the edited text. Since nodereference only stores the node's nid this is not possible.
But, since the form allows you to edit the title the client assumes they can do this. Only after submitting does the validation code say the title does not match the nid.
The attached patch adds a title field so that altered titles are accepted, removes the validation, and adds an install update function (make sure to run update.php after applying the patch).
I cannot think of a reason not to do this. If this is not the preferred default behavior then my next proposal is to make altering the title a configurable option for the widget.
| Comment | File | Size | Author |
|---|---|---|---|
| nodereference-alter-title.patch | 4.75 KB | jpsalter |
Comments
Comment #1
moshe weitzman commentedI actually need this as well. Don't know what the committers think of such a feature.
Comment #2
jpsalter commentedFrom the CCK project page:
Doesn't seem likely to be supported. Maybe they'd reconsider if more people requested this feature?
Comment #3
ccshannon commentedI'm using the D6 version, but I, too, have a client who instinctively try to edit the headline in the text box for autocomplete nodereference field. They Save the node and get a validation error about the title not matching. This confuses them greatly.
What they really need/want is a Node edit popup form that allows the Node to be edited from within the referrer node.
So, now I'm trying to figure out how to make that happen.
Comment #4
choster commentedComment #5
hefox commentedccshannon:
http://drupal.org/project/inline_references
In general the original topic, the way to do ialt title for node referene in 6.2 branch would make a new cck field (not through ui, through cck field creation code) that consist of a node reference and a title field.
Comment #6
Gabriel R. commentedI often need this for different clients. Would love to see it in nodereference itself instead of another module.
BTW, is the patch for D6?
Comment #7
fgmnodereference and userreference for Drupal 7.x are now maintained separately in the References module: moving issue over there.
Comment #8
fgmCategorizing.
Comment #9
obrienmd commentedWhile I understand the idea (coming here from http://drupal.org/node/157545, where good_man says he has a patch for this), would a custom field type w/ ref and title, or some "multigroup" style solution (some options are in -dev for D7) not work better for this?
Comment #10
good_man commentedThe initial patch is ready there http://drupal.org/node/157545#comment-3991340