Closed (won't fix)
Project:
Address field for CCK
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2008 at 12:23 UTC
Updated:
22 Jul 2009 at 05:23 UTC
I would like to request the following feature:
Comments
Comment #1
rconstantine commentedWow! That is some feature request. However, although I can understand the usefulness of such features, it would require an entire rewrite of this module, which I cannot do at this time and I'm not sure I would want to.
However, you might be able to design an add-on module for this one. I'll address your points in order:
1) I am unfamiliar with how node reference currently works, but an add-on module could form-alter the fields you mention to be text fields with auto-complete. It would also possibly need to override the validation and submission functions.
2) This would not directly be handled by the add-on module, unless you mean that you can choose which content type is associated with each field when you setup the address field. I think a better way is what I describe in #4 below.
3) I partly addressed this one in #2. Selection of which field of a node to use might prove tricky. Is there a reason not to give the city nodes' title the name of the city and then just stick to that? I think the tables for this module could be expanded on by the add-on module to include the nid that the state, city, or whatever points to. It seems to me that each should have just one node, and many of these fields can point to the same node. In other words, you will have many references to Dallas in the address field of many nodes, but only one Dallas City Node, right?
4) To speed things up, I would also suggest storing a copy of the node title in the address tables. This would only require a hook_nodeapi case to deal with title changes. For states and countries, this would allow the use of existing add-on modules to populate country and state lists. Country and state could operate as they do now if the add-on module, rather than having the address field set the node reference, allowed a user to associate a node with an address field. What I mean is this: You are thinking of associations of address parts to nodes. What if you turned that around and associated nodes to address parts. For example, with cck_address installed as well as an add-on module which modifies the tables, you could have options of fields to place on nodes called address references. So let's say that you make a city node. That node has the add-on module's state reference field in it. You are presented with a country drop down and a state drop down. The node ID of the state node you just made is then added to the address master table of states. Then, automatically, all nodes that use the standard address field could have their display altered to link the state field to that node. Am I being clear in my explanation? In other words, when you create a city, state, region, or country node, tie it to the address module there, then automatically turn address display text into links to those nodes (or add a simple checkbox to the content type creation to prevent links from being made).
5) Your first two sentences are how things work now. The third sentence has been addressed somewhat in the past. However, I think you are thinking of simple text-field autocomplete, which has not been considered before and should work. Previously, users requested that this module come with lists of cities, which would be impractical due to the number of cities and the number of new cities each year.
6) The add-on module could do this.
I hope you find this view of things useful. Like I said, I'm not going to tackle this myself, but would welcome a contributed add-on module to roll with the tarball of this one. That would allow users to choose which functionality they want. I was writing my suggestion in #4 on-the-fly, so it may not be as clear as it could be. If you would like clarification, let me know.
Comment #2
sandeepyadav commentedhi
I want to add more country an states corresponding that countries. How would this possible?
Is there any possible node to add them ?