Is it possible to remove the [nid:*] when we edit the node, for normal users this might look scary / confusing

Comments

dwightaspinwall’s picture

StatusFileSize
new4.46 KB

I 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.

Michsk’s picture

haven't got the time to check it out, it will be tested first thing tomorrow.

chien_fu’s picture

I will try this out as well.

chien_fu’s picture

I 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?

fourmi4x’s picture

FYI, 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