The NAT module is a helper module used to maintain node-term relationships, i.e. when a node is created a taxonomy term is created automatically using its title and body in any associated vocabularies. This module also attempts to preserve hierarchical relationships where possible.

From http://drupal.org/node/348206:

On the NAT settings page it lists all your content types.
For each content type, you can enable NAT and associate a vocabulary to it
When a node of one of the NAT enabled content types is created, a vocabulary is created.
The node title is the term name, and optionally, the node body is the term description.

I use it when I want my taxonomy terms to contain more fields than just a title and description.
some things are a bit buggy (see issue queue). But for automatically generating a term when (certain) nodes are created, it works well.

Installation

(nat 6.x-1.x dev)

Install the module as usual. The module creates a table named nat containing nid, vid, tid. Node id. Vocabulary id. Term id.

Go to Administer By module. You get the following error message.
* warning: Invalid argument supplied for foreach() in /home/peter/public_html/includes/common.inc on line 928.
* warning: strtr() [function.strtr]: The second argument is not an array in /home/peter/public_html/includes/common.inc on line 945.

You get two options under NAT.

  • Configure permissions
  • NAT

The only permission is administer NAT configuration.

Connect a content type to your vocabulary

Create your vocabulary then create a content type to go with the vocabulary. For my test at PeterMoulding.com, I created a vocabulary named technology then a content type named technology. Go to Administer » Site configuration » NAT then select the content type from the settings list.

NAT settings lists all your content types and has an expandable list of options for each one. The following list appears for each content type. I selected content type technology and, in Vocabularies:, selected technology.

  • Vocabularies: A drop down list of vocabularies. Select the on for this content type. Creating a node of type technology will automatically create a term in any selected vocabularies.
  • [ ] Associate node body with term description.
  • [ ] Delete associated term if a node is deleted.
  • [ ] Allow users to define synonyms and related terms when they create and edit nodes.
  • [ ] Make NAT terms in technology node views point to the associated node rather than the taxonomy page.

I started with [*] Associate node body with term description switched on to see how it works because that is the one thing I want to work. Save the configuration change.

I have existing pages and terms. I selected the Sync tab then switched on technology ‹-› technology then hit the Sync tables button. The node named Debian, of content type technology, was synced to term Debian. Whoops, it did not work. Instead NAT created a new term named Debian. See issue http://drupal.org/node/170200.

I used PHPMyAdmin to edit the nat table and change the tid back to the original tid then deleted the duplicate term created by NAT.

I created the node page, http://petermoulding.com/node/820, without a path alias or a menu entry.
The term page is at http://petermoulding.com/taxonomy/term/396.
I manually created an alias for the term page: http://petermoulding.com/debian
I manually created a menu entry for the alias debian. You can see it under Technology, Software, Linux.

Create your node content with manual formatting

NAT copies the node body into the term description when the node body is updated. NAT copies the body without formatting. You have to format the body content with html paragraph elements and everything else that might be created automatically by Drupal or other add on options.

A great enhancement to NAT would be to load the node body when the term page is viewed and copy the formatted node body into the term description.

Delete associated term if a node is deleted

I do not know if using this is a good idea. Does it check if nodes already use the term? Test this option and add the results to this page.

Allow users to define synonyms and related terms when they create and edit nodes

This sounds like a good idea. I did not test it. Please test it and add the results here.

Make NAT terms in technology node views point to the associated node rather than the taxonomy page

If you use this, I think you end up with the node page unmodified. You then would not have the list of pages using the term. Worth testing and adding the results here. Perhaps NAT could provide a token to add the page list to the node page.

Alternatives

Taxonomy Node

I tried Taxonomy Node at http://petermoulding.com/ and it created nodes for terms but appears to not use the node contents in the term page, as described in http://drupal.org/node/929202. NAT solved the content-description problem.