From coupet:
further observation:
Import as per field values on a per record basis.
Enable the Location module
Enable the Locative information for cck content type in administer » settings » content typescreated a cvs file that include location information:
Location Name, Street, Additional Address, City, State or Province, Zip or Postal Code, Country, Latitude, LongitudeUnable to import State or province, Country
Successfully imported Location Name, Street, Additional address, City, Zip or Postal CodeNote: Location module is distributed with State or Province table and Country table
#9 submitted by coupet on May 17, 2006 - 18:40unable to import States or Province codes.
as per supported location include files, the field value for States or Provinces can have the following values:
LIV, LND, LUT, MAN, MDW (examples for UK Provinces)
NY, CT, AL, NJ, DC (examples for US States)The country code import works nicely.
uk, us (examples for United Kingdom and United States)References
'LIV' => "Liverpool", 'LND' => "London City of", 'LUT' => "Luton", 'MAN' => "Manchester", 'MDW' => Medway"
'NY' => "New York", 'CT' => "Connecticut",
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | import_location_1.inc | 1.96 KB | dado |
Comments
Comment #1
dado commentedI cannot reproduce this error. Could you clarify what is the current state of the problem (apologies I am slightly confused by conflicting statements above).
Thanks
Comment #2
coupet commentedupdate: Unable to import State or Province, successfully imported all other fields.
Comment #3
Robrecht Jacques commentedIf you set country to something like "be", "us", "uk" => country is imported.
You need to set state/province to something like "us-CA", "uk-LIV", not just "CA" or "LIV".
I will check whether there is an easy way for node_import to know this. Maybe even allow things like "California" and "Liverpool" or at least be case-insensitive. Need to check location.module a bit more.
Does importing work if you us "us-CA" ?
Comment #4
coupet commentedit works perfectly as advised. thanks
Comment #5
dado commentedRobrecht,
I attach a slightly revised version of import_location.inc
This version populates the country field with the value selected for that record. If no country value was specified, it populates the country field with the user's default country. Please let me know what you think
dado
Comment #6
dado commentedI should have said:
If no country value was specified, it populates the country field with the site's default country.
Comment #7
coupet commentedIt works nicely, but for the province, the field value was uk-LIV, and it inserted United States as default value.
suggest having a seperate section to include default global value for country similar to taxonomy.
Comment #8
coupet commentedexcellent, should be perfect, suggest advise the user in the wizard of Location country default value.
Home » administer » settings » location
Default country selection:
Comment #9
Robrecht Jacques commentedDado's patch committed.
I'll check later how to do this country and province/state correctly, but I need to read some things about location module first.
Comment #10
Robrecht Jacques commentedFixed in CVS: you can now enter the name of the country (Belgium) or the country iso code (be). The same is true for province/state: either enter the name (New York), the full code (us-NY) or the abbreviated code if the country is set (NY).
Comment #11
Robrecht Jacques commentedSo "fixed".
Comment #12
(not verified) commented