diff --git a/smartqueue.install b/smartqueue.install
index d609793..f4aa502 100644
--- a/smartqueue.install
+++ b/smartqueue.install
@@ -25,6 +25,12 @@ function smartqueue_schema() {
         'default' => 0,
       ),
     ),
+    'use_parents_all' => array(
+      'description' => 'Whether a queue is to use all the terms ancestors when displaying the queue selection.',
+      'type' => 'int',
+      'size' => 'tiny',
+      'default' => 0,
+    ),
     'primary key' => array('qid'),
   );
 
@@ -99,3 +105,16 @@ function smartqueue_update_7002() {
 
   return t('The {smartqueue} table has been cleaned.');
 }
+
+/**
+ * Add use_parents_all.
+ */
+function smartqueue_update_7003() {
+  $spec = array(
+    'description' => 'Whether a queue is to use all the terms ancestors when displaying the queue selection.',
+    'type' => 'int',
+    'size' => 'tiny',
+    'default' => 0,
+  );
+  db_add_field('smartqueue', 'use_parents_all', $spec);
+}
diff --git a/smartqueue.module b/smartqueue.module
index 3bf5767..b9aff25 100644
--- a/smartqueue.module
+++ b/smartqueue.module
@@ -37,6 +37,13 @@ function smartqueue_taxonomy_nodequeue_form($queue, &$form) {
     '#default_value' => isset($queue->use_parents) ? $queue->use_parents : 0,
   );
 
+  $form['placeholder']['use_parents_all'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Assume all ancestor terms for hierarchical vocabs'),
+    '#description' => t("Instead of using just the node's terms for nodequeue assignment use all the ancestors of a term in addition. This has no effect if there in non hierarchical vocabularies."),
+    '#default_value' => isset($queue->use_parents_all) ? $queue->use_parents_all : 0,
+  );
+
   $form['subqueue_title'] = array(
     '#type' => 'textfield',
     '#title' => t('Subqueue title'),
@@ -85,6 +92,7 @@ function smartqueue_taxonomy_nodequeue_form_submit_finish($queue, $form_state) {
     db_update('smartqueue')
       ->fields(array(
         'use_parents' => $form_state['values']['use_parents'],
+        'use_parents_all' => $form_state['values']['use_parents_all'],
       ))
       ->condition('qid', $queue->qid)
       ->execute();
@@ -95,6 +103,7 @@ function smartqueue_taxonomy_nodequeue_form_submit_finish($queue, $form_state) {
       ->fields(array(
         'qid' => $queue->qid,
         'use_parents' => $form_state['values']['use_parents'],
+        'use_parents_all' => $form_state['values']['use_parents_all'],
       ))
       ->execute();
   }
@@ -127,6 +136,13 @@ function smartqueue_taxonomy_nodequeue_subqueues(&$queue, $node) {
     }
   }
 
+  if (!empty($field_names) && $queue->use_parents_all) {
+    // Replace taxonomy IDs with all their parents'.
+    foreach ($field_names as $field_name => &$tids) {
+      $tids = smartqueue_taxonomy_get_children($tids);
+    }
+  }
+
   // Forbid NO terms being set, but allow
   // various non-terms to be set.
   $empty = TRUE;
@@ -173,9 +189,10 @@ function smartqueue_nodequeue_alter(&$data, $type) {
     case 'load_queues':
       if (!empty($data)) {
         $qids = array_keys($data);
-        $result = db_query("SELECT qid, use_parents FROM {smartqueue} WHERE qid IN (:qids)", array(':qids' => $qids));
+        $result = db_query("SELECT qid, use_parents, use_parents_all FROM {smartqueue} WHERE qid IN (:qids)", array(':qids' => $qids));
         foreach ($result as $queue) {
           $data[$queue->qid]->use_parents = $queue->use_parents;
+          $data[$queue->qid]->use_parents_all = $queue->use_parents_all;
         }
       }
       break;
@@ -328,3 +345,20 @@ function smartqueue_taxonomy_nodequeue_autocomplete($queue, $subqueue, $string,
 
   return $matches;
 }
+
+
+function smartqueue_taxonomy_get_children($tids) {
+  if ($tids) {
+    $parent_tids = array();
+    foreach ($tids as $tid) {
+      $parent_terms = taxonomy_get_parents_all($tid);
+      foreach ($parent_terms as $term) {
+        $parent_tids[] = $term->tid;
+      }
+    }
+    return $parent_tids;
+  }
+  else {
+    return array();
+  }
+}
