I've managed to install the module without problems (i think).
Now, I'm having trouble understanding the structure of the CSV file and how to use the module in CCK.
I want a user to identify the Province and City where he is from. (Where, after selecting a Province, he is limited to the Cities for that Province only) Do I create a Fixed Data fields for both items, province and city?
In this case, should my CSV file look like the following?
Prov1, City1
Prov1, City2
Prov2, City1
Prov2, City2
Prov3, City1
Prov4, City1
How do I set the value for the City field?
I tried searching for help documents or and previous posts, but I can't seem to find any. Any links to documentation about this module will be helpful.
Thanks.
PS
We have about 1,500 towns and 70 provinces.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | prov-town.csv_.txt | 482 bytes | tumnus |
Comments
Comment #1
tumnus commentedbtw, I am using version 5.x-1.2
Comment #2
markfoodyburton commentedJust a single FixedDataDropdown should do the job nicely!
Looks perfect,
So, you now need to create your CCK field type, and when you are doing so, you'll see that there is a place to "upload" the CSV file, (as above). Then you need to make sure that the regular expression correctly extracts the province and city, and with luck, your done. I'd suggest trying a small file of a few entries first, get that working, then go for the big file.
Then the user should see a free text area where they start typing in the province, which will auto-complete - and then the city drop down will be filled in with the names of the city's in the province....
Cheers
Mark.
Comment #3
markfoodyburton commentedJust a single FixedDataDropdown should do the job nicely!
Looks perfect,
So, you now need to create your CCK field type, and when you are doing so, you'll see that there is a place to "upload" the CSV file, (as above). Then you need to make sure that the regular expression correctly extracts the province and city, and with luck, your done. I'd suggest trying a small file of a few entries first, get that working, then go for the big file.
Then the user should see a free text area where they start typing in the province, which will auto-complete - and then the city drop down will be filled in with the names of the city's in the province....
Cheers
Mark.
Comment #4
tumnus commentedThanks for the quick response.
After I created the field-type, I got the following error:
Checking further, it appears that the csv file was not uploaded at all. I tried this several times but I'm having difficulty uploading the complete .csv file. Since I don't see any progress indicator, it's difficult to say if anything has been uploaded at all. This CSV file is a partial version containing only 27 records. I'm attaching it for reference.
I then tried to use the form I just created. Typing a province or a city doesn't produce anything on the dropdown.
I am wondering about the performance hits of the 1,500 town selector. I am thinking of doing several dependent dropdown fields Island group > Region > Province > Cities. Is it possible to create relationships between several dropdown fields?
PS
I appended ".txt" to the file otherwise I won't be able to attach it here. The original I tried to upload was just prov-town.csv.
Comment #5
markfoodyburton commentedHi
The problem is clearly with this mysql error....
I took your data, and created a fdd myself. I didn't even change the RegExp from the default, and it worked perfectly.
So, this must be something to do with versions, I'm using php 5.x and mysql 5.x.
However, I have been a bad boy, and used the MYSQL syntax within a db_query, and used the ON DUPLICATE KEY UPDATE syntax, which, looking at it now might be a mysql extension. So - at a guess your using postfix, or mysqli or some such?
Anyway, the fix should be simple, but I'm not sure I will get to it today - please feel free to have a look yourself, or hopefully I'll get to it early this week sometime :-)
Cheers
Mark.
Comment #6
tumnus commentedi see. well, i'm using pretty older verions. PHP version is 4.4.1 and while MySQL version is 4.0.27-standard. my webhost is offering to upgrade me to a new physical server but i haven't gotten around to doing it.
so, what else can i do at the moment?
By the way, I thought I'd like the n-deep nesting request here: http://drupal.org/node/148803
Any chance it would see the light of day soon?
Comment #7
markfoodyburton commentedAhh, very old versions, none the less, I thin my code should be cleaner, and it might help you. I'll work on it when I can.
For the other wish-list items, please get in touch using the contact form.
Cheers
Mark.
Comment #8
markfoodyburton commentedHi, I've fixed this issue, and the update is checked into the cvs. If you can confirm that it works for you, then I'll make a release
Cheers
Mark.
Comment #9
tumnus commentedWhen you say it's in CVS, you mean to say I should download this version: FixedDataDropdown-5.x-1.x-dev.tar.gz?
Anyway, I did just that and I am still getting error messages:
Trying out the field, I only get the last town of every province. (i.e. If there are 12 towns in a province, I only get the 12th one in the dropdown list).
Thanks for the help.
Comment #10
(not verified) commented