By tms8707056 on
I would like to remove the [nid:12] from an autocomplete node reference field so that only the node title is displayed. Is there a way to do this?
I would like to remove the [nid:12] from an autocomplete node reference field so that only the node title is displayed. Is there a way to do this?
Comments
OK. So I figured out how to
OK. So I figured out how to do part of what I wanted to do by hacking the node reference module for CCK. My code is below. This method works but if there is a better way to do this I am all for it. I have commented where I made changes.
If possible I would prefer a method that loads the information from the selected user node in a seperate section on the page (automagically using ajax?). I will have a couple of users that have the same but are name at two different locations. The idea behind this functionality is to verify that the correct user is selected at the appropriate location. Any help is appreciated.
I have also figured out that
I have also figured out that the views integration also provides this functionality. Learn something new everyday!
Would you be able to explain
Would you be able to explain (or post a link) as to how you altered the output from the node reference autocomplete using Views?
I would be interested in knowing the steps you took in order to do this as I can't find any articles about this.
Regards,
Andrew
I should have clarified my
I should have clarified my last post. It doesn't remove the nid from the field as the title of this thread suggests. I figured out how to add information to the drop down results list for the auto complete field.
You simply create a view that returns nodes that you want listed in the auto complete field. You add the fields you want to the view. These will show up in the search results list. You then set the auto complete field to reference the view results instead of the node type.
also posted the request at
also posted the request at CCK issue queue:
#640832: Remove [nid:n] in nodereference fields, so only title is shown
My Drupal sites: