Drupal: automatically add new nodes to a nodequeue

前端 未结 7 2115
旧巷少年郎
旧巷少年郎 2021-01-20 04:16

Can I somehow automatically add a node to a specific nodequeue when it is created ?

(I\'m using nodequeue module: drupal.org/project/nodequeue)

thanks

7条回答
  •  广开言路
    2021-01-20 05:03

    I'm using drupal 5 which doesn't have rules. This is how I accomplished it, I'm not using any subqueues:

    if($op == 'insert'){
        if($node->type == 'node_type'){
            $queue = nodequeue_load(4);
            $subqueue = nodequeue_load_subqueue(4);
            nodequeue_subqueue_add($queue, $subqueue, $node->nid);
        }
    }
    

提交回复
热议问题