Taxonomy is a feature in Drupal that, in its most basic form, helps users organize content on a site. Taxonomy does not need to be used for a site to work, but when used it can help a site work much more efficiently and dynamically.
In it's simplest form, Taxonomy makes lists that are turned into selection list boxes or drop-down boxes on a content submission form. Whoever builds the Taxonomy vocabulary determines the items in the list.
For example a website devoted to music may want the ability to classify music by genre. A simple list such as the one below may be used:
Sometimes, though, classification lists may contain sub-items in a more hierarchical structure. As an example, a hierarchical list of musical genres could be similar to:
Taxonomy provides the ability for content contributors to create complex lists such as this and then use the list as "controlled keywords", which can be associated with content type submission forms.
When these lists are associated with content type submission forms, content contributors can then tag their content with the appropriate options. Doing this produces a few different results, some obvious, some not as obvious.
One of the most obvious results is that when users view a node to which a tag has been assigned, along with the content, many themes will display the accompanying tags as links. Clicking the link will display a view of all other content tagged with the same term.
Something that may not be immediately obvious is the fact that Taxonomy terms, when used as an advanced feature with Views, provide an exceptionally powerful tool for grouping, sorting, and filtering the dynamic display of content.
To administer Taxonomy, go to Admin menu > Content management > Taxonomy.
Drupal's Taxonomy feature has been extended with the Taxonomy CSV module to provide the ability to export vocabularies, which can then be imported to other sites. This is a tremendous time saver, especially for administrators who oversee multiple sites that need a similar information architecture structure.
Taxonomy CSV offers many different export options and requires different input for the types of vocabularies you are trying to export. Following is an example of a relatively simple, flat (non-hierarchical) vocabulary export:
Go to Admin menu > Content management > Taxonomy > CSV export.
In the 1. What do you want to export? fieldset, select the desired items you wish to export from the CSV format field. There are several options, some more complex than others. The Term names option is the default. Also select the vocabulary, or vocabularies, that you would like to export from the Vocabulary to export field.
The default settings in the 2. How do you want to format your CSV file? fieldset should suffice for most cases.
The 3. Advanced and specific options fieldset contains options that will allow you to affect the order that terms are output. The default settings should suffice unless a different order is preferred. When completed, click the Export button at the bottom of the page.
The screen will indicate that it is processing the data for a few seconds. When completed, a small status report with a yellow background will show at the top of the screen.
A file download dialog box will appear. Save the file to your computer.
Importing vocabularies can be a significant time saver and can also ensure consistency between different sites. To import a vocabulary you must first have some source information for the vocabulary. Taxonomy CSV allows a user to import vocabularies from a file or from a paste entry.
To import a vocabulary from a file, you must first have a file. For instructions on how to complete a taxonomy export, please see the Export Vocabularies article. Once you have a file, to import it do the following:
Go to Admin menu > Content management > Taxonomy > CSV import.
Initially you will see a large warning message at the top of the Taxonomy Import page. This warning message seems is aimed towards imports of very large, complex vocabularies - between 1000 and 10,000 terms. CWS has tested this feature against moderately sized vocabularies. If your vocabulary is extremely large, please contact us at http://oregonstate.edu/cws/contact so we can help you out.
In the 1. What do you want to import? fieldset, select the items you wish to import from the drop down menu. If you would like to keep the order of your terms, check the Keep order of terms checkbox, otherwise the terms will be listed alpha-numerically. Please note that complex taxonomies that involve many different levels, definitions, and relationships, may not order perfectly upon import and may need some editing after the import is performed.
In the 2. Where are items to import? fieldest, select where the import information is coming from. In the example below, we are importing a file that was created by an export from another site. If you choose the In a local file option the screen will change slightly to provide an uploader tool, as shown below. Click the Browse button to connect your Drupal site to your computer and upload your import file.
In the 3. How is your source formatted? fieldset, you will be provided several different options regarding the format of the file you are importing. In this case, we have a comma separated list of items for import - which is the most common. All this means is that commas are used between each of the terms to designate them as separate items. If you are not certain what the file contains, open it and look to see what character is separating your terms.
A CSV value enclosure is punctuation, typically quotation marks, that is commonly used to surround and preserve non-English characters that may be used in a term or phrase. If you are uncertain whether your import file contains enclosures, open the file and look inside. If you see quotation marks surrounding your terms, then choose the Quotation marks option. If you see some other type of punctuation surrounding your terms, choose Custom enclosure. In our sample, there is no enclosure used in the file.
In the 4. Which vocabulary do you want to import into? fieldset, Taxonomy CSV will let you import terms into existing vocabularies if desired. If this is the case, selet the vocabulary you wish to import into. In our case, we will create a brand new vocabulary by selecting the Autocreate a new vocab option.
The 5. When a term exists, what to do with it? fieldset determines how to handle duplicate terms. In the sample below, the option to update the existing term is chosen.
The final fieldset, 6. Information on process, determines how to handle the display of statistics regarding the import, logging activity, and how to display report elements. Typically the default settings will suffice here for normal use.
Once all desired settings have been made, click the Import button at the bottom of the screen.
After the import has processed, a large yellow report will appear at the top of the screen. Since we are automatically creating a new vocabulary from this import, a generic vocabulary name will be assigned by the system. A link is provided, as shown below, whereby you can go in and edit the vocabulary. Just click the link.
You will be redirected into the vocabulary's edit screen.
Change the vocabulary name and description, if desired. You can also associate this vocabulay with any existing content types, if needed, as well. When you're finished, just click the Save button at the bottom of the screen.
Upon saving you will be redirected to Taxonomy's main overview screen. A yellow message will appear at the top informing you that the filter cache has been cleared and there may be a temporary performance degredation while it's being rebuilt. This is normal.