Skip to content

Instantly share code, notes, and snippets.

@benclark
Forked from brockboland/nodequeue_create.php
Created September 21, 2012 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benclark/3763079 to your computer and use it in GitHub Desktop.
Save benclark/3763079 to your computer and use it in GitHub Desktop.
Drupal: Create a nodequeue if it doesn't exist already
drupal_load('module', 'nodequeue');
// Homepage Features
$queue = nodequeue_load_queue_by_name('homepage_features');
if (empty($queue)) {
$queue = new stdClass();
$queue->title = 'Homepage Features';
$queue->name = 'homepage_features';
$queue->size = 4;
$queue->owner = 'nodequeue';
$queue->types = array('homepage_feature');
$queue->reverse = $queue->count = $queue->i18n = $queue->reference = 0;
$queue->subqueue_title = $queue->link = $queue->link_remove = '';
$queue->new = $queue->show_in_tab = $queue->show_in_ui = TRUE;
$queue->show_in_links = FALSE;
$queue->roles = $queue->subqueues = array();
$queue->add_subqueue = array(
'Homepage Features',
);
nodequeue_save($queue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment