Active
Project:
Nodequeue
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2011 at 14:58 UTC
Updated:
24 Oct 2011 at 08:44 UTC
hi,
term 1
- Term 2
-- Term 3
-- Term 4
term 5
- Term 6
....
would be very difficult for the nodes with the term 4 for example, can be added in the queues for the terms 4, 2 and 1 according to the inheritance relationship? without having to select multiple terms (their parent term).
that is, if I create a node associated with the term 4, allowing adding to taxonomy queues of terms 1 and 2
is this possible? some help to implement it?
sorry for my English, I hope I have explained
thanks!
Comments
Comment #1
pepejose commentedHi again
I have seen this -> http://drupal.org/node/1215868 .
http://www.domain.com/nodequeue/3/add-node/8/90?tab=1&destination=node/90/nodequeue&token=7w_2tXkGafdsadoLBWROI33ooL17eoGPtoG-tb40xPwsafdsafdKoo
that number 8, is the id of the subqueue, if I change for another subqueue id it works and adds it to the subqueue
I've tested and works, but of course, is not comfortable or clean, and it´s a bad workaround...
thanks again
Comment #2
pepejose commentedhello again,
I made a small temporary hack to add a node to the corresponding taxonomy term in addition to all his parents.
But of course, is not comfortable or clean, and it´s a bad workaround . Appreciate that the developer add this option to the UI because it is not difficult to implement.
now
[Checkbox] "Assume vocabs hierarchical parent term for"
with the new option
[Checkbox] "Assume vocabs hierarchical parent term for"
[Checkbox] "can also add to the queues of the terms father" (or something similar)
Thank you, greetings.
***************************************************************************************************
function added to smartqueue.module
+function smartqueue_taxonomy_get_all_parents($tids) {
+ if ($tids) {
+ $top_level_tids = array();
+ foreach ($tids as $tid) {
+ $parents = taxonomy_get_parents_all($tid);
+ foreach ($parents as $index => $parent){
+ $top_level_tids[$index] = $parent->tid;
+ }
+ }
+ return array_unique($top_level_tids);
+ }
+ else {
+ return array();
+ }
+}
function call on hook_nodequeue_subqueues()
function smartqueue_taxonomy_nodequeue_subqueues(&$queue, $node){
+foreach ($field_names as $field_name => &$tids) {
+ $tids = smartqueue_taxonomy_get_all_parents($tids);
+ }
}