Skip to content

Instantly share code, notes, and snippets.

@brockboland
Created September 21, 2012 18:13
Show Gist options
  • Save brockboland/3763034 to your computer and use it in GitHub Desktop.
Save brockboland/3763034 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