diff --git a/ds_term_with_parents.module b/ds_term_with_parents.module
index f09c594..3f58e9e 100644
--- a/ds_term_with_parents.module
+++ b/ds_term_with_parents.module
@@ -5,45 +5,37 @@
  */
 function ds_term_with_parents_ds_fields_info($entity_type) {
   $fields = array();
+  $info = entity_get_info($entity_type);
 
-  if ($entity_type == 'node') {
-    foreach (node_type_get_types() as $type) {
-      $bundle = field_extract_bundle($entity_type, $type);
-      $instances = field_info_instances('node', $bundle);
-      foreach ($instances as $name => $instance) {
-        $field = field_info_field($instance['field_name']);
-        if (isset($field['type']) && $field['type'] === 'taxonomy_term_reference') {
-          if (is_array($fields['node']['ds_term_with_parents_' . $name])) {
-            $fields['node']['ds_term_with_parents_' . $name]['ui_limit'][] = $type->type . '|*';
-          }
-          else {
-            $fields['node']['ds_term_with_parents_' . $name] = array(
-              'title' => t('Term with parents: ' . $instance['label']),
-              'field_type' => DS_FIELD_TYPE_FUNCTION,
-              'function' => '_ds_term_with_parents_term_with_parents',
-              'ui_limit' => array($type->type . '|*'),
-              'entity_render_key' => 'name',
-              'properties' => array(
-                'bundle' => $bundle,
-                'field_name' => $field['field_name'],
-                'formatters' => array(
-                  'term_with_parents_parent' => t('Parent first'),
-                  'term_with_parents_child' => t('Child first'),
-                ),
-                'settings' => array(
-                  'link' => array('type' => 'select', 'options' => array('no', 'yes')),
-                  'separator' => array('type' => 'textfield', 'description' => t('Separator for terms')),
-                  'class' => array('type' => 'textfield', 'description' => t('Put a class on the wrapper. Eg: block-title')),
-                ),
-                'default' => array('link' => 1, 'separator' => ' ', 'class' => ''),
-              ),
-            );
-          }
-        }
+  foreach (array_keys($info['bundles']) as $bundle) {
+    $instances = field_info_instances($entity_type, $bundle);
+    foreach ($instances as $name => $instance) {
+      $field = field_info_field($instance['field_name']);
+      if (isset($field['type']) && $field['type'] === 'taxonomy_term_reference') {
+        $fields[$entity_type]['ds_term_with_parents_' . $name] = array(
+          'title' => t('Term with parents: ' . $instance['label']),
+          'field_type' => DS_FIELD_TYPE_FUNCTION,
+          'function' => '_ds_term_with_parents_term_with_parents',
+          'entity_render_key' => 'name',
+          'properties' => array(
+            'field_name' => $field['field_name'],
+            'formatters' => array(
+              'term_with_parents_parent_only' => t('Parent only'),
+              'term_with_parents_parent' => t('Parent first'),
+              'term_with_parents_child' => t('Child first'),
+            ),
+            'settings' => array(
+              'link' => array('type' => 'select', 'options' => array('no', 'yes')),
+              'separator' => array('type' => 'textfield', 'description' => t('Separator for terms')),
+              'class' => array('type' => 'textfield', 'description' => t('Put a class on the wrapper. Eg: block-title')),
+            ),
+            'default' => array('link' => 1, 'separator' => ' ', 'class' => ''),
+          ),
+        );
       }
     }
   }
-  
+
   return $fields;
 }
 
@@ -62,21 +54,50 @@ function ds_term_with_parents_ds_field_format_summary($field) {
 }
 
 /**
- * Output term and parents.
- */
+* Output term and/or parents.
+*/
 function _ds_term_with_parents_term_with_parents($ds_field) {
-  $field_items = field_get_items('node', $ds_field['entity'], $ds_field['properties']['field_name']);
+  $terms = array();
+  $field_items = field_get_items($ds_field['entity_type'], $ds_field['entity'], $ds_field['properties']['field_name']);
+
+  // Enable a cache for the parent terms to avoid duplicate output.
+  if ($ds_field['formatter'] === 'term_with_parents_parent_only') {
+    $cache = array();
+  }
+
   foreach ($field_items as $field) {
     $parents = taxonomy_get_parents($field['tid']);
+
     foreach ($parents as $parent) {
-      $terms[] = $parent;
+      if ($ds_field['formatter'] === 'term_with_parents_parent_only') {
+        // Make sure to display the parent only once for a set of children terms.
+        if (!isset($cache[$parent->tid])) {
+          $cache[$parent->tid] = array();
+        }
+
+        $info = entity_get_info($ds_field['entity_type']);
+
+        if (!isset($cache[$parent->tid][$ds_field['entity_type']])) {
+          $cache[$parent->tid][$ds_field['entity_type']] = array();
+        }
+
+        if (!in_array($ds_field['entity']->{$info['entity keys']['id']}, $cache[$parent->tid][$ds_field['entity_type']])) {
+          $cache[$parent->tid][$ds_field['entity_type']][] = $ds_field['entity']->{$info['entity keys']['id']};
+          $terms[] = $parent;
+        }
+      }
+      else {
+        $terms[] = $parent;
+      }
     }
-    if (!isset($field['taxonomy_term'])) {
-      $field['taxonomy_term'] = taxonomy_term_load($field['tid']);
+    if ($ds_field['formatter'] !== 'term_with_parents_parent_only') {
+      if (!isset($field['taxonomy_term'])) {
+        $field['taxonomy_term'] = taxonomy_term_load($field['tid']);
+      }
+      $terms[] = $field['taxonomy_term'];
     }
-    $terms[] = $field['taxonomy_term'];
   }
-  
+
   // Option child first ==> reverse array
   if ($ds_field['formatter'] === 'term_with_parents_child') {
     $terms = array_reverse($terms);
