Hey peoples,
I need some advice on creating a taxonomy structure for addresses. Specifically for a Spanish address block.
I need to have the structure:
Province
|----------Town/City
However I need to display this as select lists, and there are 45 Provinces. Upon selecting a Province, the Town/City select list will change to contain values specific to that Province.
The only way I can think of doing this is creating:
- a 'Province' vocabulary containing a list of provinces as terms
- 45 'Province - [provinceName]' vocabularies each containing a list of cities
- using conditional fields to hide all town/city fields, showing only each individual field as needed
However, this seems to be a bit cumbersome and I'm worried about the amount of dependencies being used. Any thoughts/tips?
Keith
Comments
45 'Province -
Use a single 'Cities' vocabulary, and use a reference from each city to the province it belongs to. You can then use https://drupal.org/project/reference_option_limit to take care of limiting the options in the UI.
Thanks joachim. Is this
Thanks joachim.
Is this suggesting I add a new field of type 'term-reference' to the 'cities' vocabulary?
Yes. You add a field on the
Yes.
You add a field on the Cities vocab, so each city term knows which region it is in.
Your module looks like what I
Your module looks like what I need, but I don't quite get the instructions on how to configure/use it.
Did you read the docs such as
Did you read the docs such as the README? If that is not clear enough or lacks detail, please file bugs!
Hierarchical Select
Have you tried using Hierarchical Select?
https://drupal.org/project/hierarchical_select
Mark Conroy,
Lead Frontend Developer,
Annertech - Web Agency of the Year 2016.
Addressfield
https://drupal.org/project/addressfield
Not sure it has all the logic you require, but worth a look.