taxonomy

Creating vocabularies and terms when installing a Drupal module | Tigerfish

function juice_install() { module_load_include('module', 'taxonomy', 'taxonomy'); $t = get_t(); // Create the vocabulary programatically. $vocab = array( 'name' => 'Juice type', 'description' => $t('The type of juice, such as apple or orange.'), 'help' => 0, 'relations' => 0, 'hierarchy' => 0, 'multiple' => 0, 'required' => 1, 'tags' => 0, 'module' => 'taxonomy', 'weight' => 0, 'nodes' => array('juice'), ); taxonomy_save_vocabulary($vocab); // Get the vid of the vocabulary we just created. $vid = db_result( db_query(