Project:Primary Term
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:sethcohn
Status:closed (fixed)

Issue Summary

A simple feature, quick&dirty: add a token for the primary term vocab:

<?php
function primary_term_token_list($type = 'all') {
//...
    
$tokens['node']['primary-termpath-raw'] = t('Full Path to Primary Term');
+   
$tokens['node']['primary-term-vocab'] = t('Name of the vocab of primary term');
     return
$tokens;
   }
}


function
primary_term_token_values($type, $object = NULL) {
//....
//....
//....
        
$values['primary-termpath-raw'] = drupal_get_path_alias(taxonomy_term_path($term));
+       
$vocab = db_fetch_object(db_query('SELECT name FROM {vocabulary} WHERE vid = %d', $term->vid));
+       
$values['primary-term-vocab'] = $vocab->name;
       }
       break;
   }
  return
$values;
}
?>

I use to with the ericduran's zip patchs: http://drupal.org/node/588166

Comments

#1

Assigned to:Anonymous» sethcohn

Seems worthwhile

#2

Rather than making the database call, should call taxonomy_vocabulary_load instead. Otherwise, +1.

#3

Version:master» 6.x-1.x-dev
Status:needs review» fixed

Committed this token along with the ones from #502138: Token support should include full path like [termpath] token:

http://drupal.org/cvs?commit=435614

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here