Skip to main content
3 of 4
Change concrete node type to uppercase
Nikit
  • 4k
  • 1
  • 20
  • 27

Depending on the version of Drupal :

drupal 6:

$nodes = db_query('SELECT nid FROM {node} WHERE type="%s"', $type);

drupal 7:

$nodes = node_load_multiple(array(), array('type' => $type));

drupal 8:

$nids = \Drupal::entityQuery('node')
  ->condition('type', 'NODETYPE')
  ->execute();
$nodes = \Drupal::entityTypeManager()
  ->getStorage('node')
  ->loadMultiple($nids);
Nikit
  • 4k
  • 1
  • 20
  • 27