diff --git token_taxonomy.inc token_taxonomy.inc index c593863..1cec84a 100644 --- token_taxonomy.inc +++ token_taxonomy.inc @@ -26,6 +26,7 @@ function taxonomy_token_list($type = 'all') { $tokens['taxonomy']['cat'] = t('The name of the taxonomy term.'); $tokens['taxonomy']['cat-raw'] = t('The name of the taxonomy term.'); $tokens['taxonomy']['cat-description'] = t('The optional description of the taxonomy term.'); + $tokens['taxonomy']['cat-synonym'] = t('The first synonym of the taxonomy term.'); $tokens['taxonomy']['vid'] = t("The unique ID of the taxonomy vocabulary the taxonomy term belongs to."); $tokens['taxonomy']['vocab'] = t("The name of the taxonomy vocabulary the taxonomy term belongs to."); $tokens['taxonomy']['vocab-raw'] = t("The name of the taxonomy vocabulary the taxonomy term belongs to."); @@ -60,6 +61,10 @@ function taxonomy_token_values($type, $object = NULL, $options = array()) { $values['cat'] = check_plain($term->name); $values['cat-raw'] = $term->name; $values['cat-description'] = filter_xss($term->description); + $synonyms = taxonomy_get_synonyms($term->tid); + if (isset($synonyms[0])) { + $values['cat-synonym'] = $synonyms[0]; + } $values['vid'] = $term->vid; $values['vocab'] = check_plain($vocabulary->name); $values['vocab-raw'] = $vocabulary->name;