summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 8cf6487b2..28d488ec8 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1418,6 +1418,10 @@ function taxonomy_field_formatter_info() {
'label' => t('Plain text'),
'field types' => array('taxonomy_term_reference'),
),
+ 'taxonomy_term_reference_rss_category' => array(
+ 'label' => t('RSS category'),
+ 'field types' => array('taxonomy_term_reference'),
+ ),
);
}
@@ -1460,6 +1464,18 @@ function taxonomy_field_formatter_view($entity_type, $entity, $field, $instance,
);
}
break;
+
+ case 'taxonomy_term_reference_rss_category':
+ foreach ($items as $delta => $item) {
+ $entity->rss_elements[] = array(
+ 'key' => 'category',
+ 'value' => $item['tid'] != 'autocreate' ? $item['taxonomy_term']->name : $item['name'],
+ 'attributes' => array(
+ 'domain' => $item['tid'] != 'autocreate' ? url('taxonomy/term/' . $item['tid'], array('absolute' => TRUE)) : '',
+ ),
+ );
+ }
+ break;
}
return $element;