Event: 
Drupal Camp Chattanooga 2020
Speaker: 
KarenS
Parent Track: 
Site Building
Audience: 
All Attendees

 

Taxonomy Place dynamically creates a 'Place' vocabulary using Address module to manage the geographical information. The taxonomy terms that are created are nested by country, then state/province, then city. The Address module is used as an API to retrieve the right country and province codes and names, and to manage the nesting of countries, provinces, and localities.

Instead of creating a huge taxonomy of all possible locations, many of which may never be used, the module creates the taxonomy terms as they are referenced. Users fill out an address field on a node to identify the place the node should be associated with. When the node is saved, the node's entity_reference field is updated to link it to the correct place taxonomy term, adding it to the vocabulary, if it doesn't already exist. In this way, the vocabulary only contains places that have actually been referenced.

In addition, the end user experience of interacting with an address field instead of a huge list of taxonomy terms is probably a nicer UX for linking content to places.

This session will demo how the module works and when it makes sense, with some background about why it was created.