Skip to content

Instantly share code, notes, and snippets.

@rachellawson
Created September 3, 2015 12:04
Show Gist options
  • Save rachellawson/4b103fab4d960078303c to your computer and use it in GitHub Desktop.
Save rachellawson/4b103fab4d960078303c to your computer and use it in GitHub Desktop.
<?php
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->entityCondition('bundle', 'article');
$result = $query->execute();
if (!empty($result)) {
$entities = entity_load('node', array_keys($result['node']));
return entity_view('node', $entities, 'full');
} else {
return array('#markup' => t('No article nodes found.'));
}
// wish I could remember this off by heart!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment