Active
Project:
Node Reference Create
Version:
6.x-1.0
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2010 at 22:32 UTC
Updated:
8 Feb 2011 at 13:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
dwightaspinwall commentedI just created a patch to do just this. Hasn't been extensively tested, so beware. There is a settings page for the module now, at admin/settings/noderefcreate, where you can choose to remove the "[nid:xxx]" from the form and the autocomplete. It is disabled by default to be save (i.e. the nid will show by default). Bear in mind that if you disable the nid and you have two or more nodes with the same title, one will be chosen arbitrarily. This feature affects only the autocomplete widgets handled by this module (all of them); no other autocomplete widgets will be affected.
Arguably, this functionality should be in a module by itself with better configurability, but I needed it in concert with noderefcreate, so I put it here.
This is accomplished by creating a custom autocomplete callback which (optionally) suppresses the nid. Also overridden is nodereference_autocomplete_value, which is responsible for the display of the node ref text in the form of an existing node.
Comment #2
Michsk commentedhaven't got the time to check it out, it will be tested first thing tomorrow.
Comment #3
chien_fu commentedI will try this out as well.
Comment #4
chien_fu commentedI just noticed the disclaimer:
"be warned that if two or more nodes of the selected types share the same node title, the resulting choice will be arbitrary"
This won't work for my application as many nodes may have the same title. Have you or has anyone else found any other way around this?
Comment #5
fourmi4x commentedFYI, there is another thread about this topic here, but about Drupal 7 : http://drupal.org/node/157545
@chien_fu : To prevent the problem of duplicate node titles, I think you can use
http://drupal.org/project/unique_field
as mentioned in the thread above