* My Problem.
Right now I've started a new project.
At the registration I need to collect user's country and city with the help of drop-down lists. The drop-down list should appear in the page with the help of AJAX accordingly to the selected country. While I was researching this problem I've found few *SOLUTIONS*:
1) Addresses Module.
2) Geonames Module combined with Hierarchical Select Module.
* Why these solutions doesn't satisfy my needs.
The first solution was not very good, because this module dynamically grabs only countries and relative regions. The city should be typed by user from keyboard. So, this solution doesn't satisfy my needs fully.
The second solution may be good. I'm not sure, because Hierarchical Select is not small module. It has very much options and possibilities. It has also even its own API. Also it doesn't provide any UI for my needs. That is why I've decided that it will be easier to create my own module that will work with Geonames module instead of creating my own module that should combine Geonames and Hierarchical Select modules features.
* About my module.
I like to use Content Profile instead of Profile module, that's why my module has Content Profile dependencies. Also it depends on CCK (Content and Text modules) and obviously on Geonames module.
I've named it Dynamic Country and City Select. It dynamically creates two cck fields accordingly to the selected Content Profile Type that can be selected at the configuration (admin) page. This cck field store the country and city geonames' codes. At the edit or view page I replace codes with according name. To display City drop-down list I use AHAH. Also administrator can select amount of cities to display in the drop-down field and whether country and city fields are required to register.
* Screeshots
http://i.piccy.info/i5/39/02/950239/registration.jpg
http://i.piccy.info/i5/45/02/950245/profile-edit.jpg
http://i.piccy.info/i5/50/02/950250/view.jpg
* Conclusion.
I thought that this module can be useful for other Drupal developers that doesn't like to write its own code. That's why I made my module a bit flexible and configurable.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | place_select_v1.2.zip | 7.52 KB | nostop8 |
Comments
Comment #1
nostop8 commentedDynamic Country and City Select contribution pack.
Comment #2
nostop8 commentedP.S.
You can read more about the module, its installation and features in the README.TXT
Comment #3
avpadernoHello, and thank you for applying for a CVS account.
I am adding the review tags, and some volunteers will review the proposed module, and report what needs to be changed.
Is there any reason why the existing projects can be changed to include the features implemented in the proposed module? Did you open feature requests for the projects you reported?
Comment #4
nostop8 commentedIt would be great if Addresses module would include the cities list to the according countries. I haven't opened that issue, because it's not so small project and I guess there was many requests about that and they are working on it.
About the Geonames Module and Hierarchical Select Module. Their specialization is a bit different. I don't think that my request to them would be appropriate. I found many posts about their combining to get the result I want to, but I haven't managed to find its working example. And again, I will repeat myself, that the Geonames and Hierarchical Select module's do not provide any UI for my specific but also popular need, so anyway the developer has to write its own module.
Anyway, I'm not really sure that the module I've created may work stable and reliable because of www.geonames.org. I'm very disappointed with this service. For the last few weeks its servers very often is down :(
Comment #5
nostop8 commentedHey there! )
I was testing my module and found out that Geonames Free Service is not so bad as I thought. The real problem was with Geonames module that caches data even if it is empty. When I've turned off Geonames module's caches everything began to work perfectly!
Comment #6
avpadernoComment #7
zzolo commentedHi. Please read all the following and the links provided as this is very important information about your CVS Application:
Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:
Migrating from CVS Applications to (Git) Full Project Applications
Comment #8
avpadernoAs per previous comment, I am setting this issue as Won't fix.
Since new users can now create full projects, applications have a different purpose and they are handled on a different issue queue. See Apply for permission to opt into security advisory coverage for more information.