Skip to content

Instantly share code, notes, and snippets.

@slucero
Created August 29, 2014 15:50
Show Gist options
  • Save slucero/cee51deacb4077a79f8e to your computer and use it in GitHub Desktop.
Save slucero/cee51deacb4077a79f8e to your computer and use it in GitHub Desktop.

Revisions

  1. slucero revised this gist Aug 29, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php
    $query = new EntityFieldQuery();
    $entities = $query->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'event')
    @@ -11,4 +12,5 @@
    $build['#nodes'] = $views['nodes'];
    $build['#theme'] = 'whatever';

    return $build;
    return $build;
    ?>
  2. slucero created this gist Aug 29, 2014.
    14 changes: 14 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    $query = new EntityFieldQuery();
    $entities = $query->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'event')
    ->propertyCondition('status', 1)
    ->fieldCondition('field_date', 'value', array('2011-03-01', '2011-03-31'), 'BETWEEN')
    ->fieldOrderBy('field_date', 'value', 'ASC')
    ->execute();

    $nodes = node_load_multiple(array_keys($entities['node']));
    $views = node_view_multiple($nodes, 'teaser');
    $build['#nodes'] = $views['nodes'];
    $build['#theme'] = 'whatever';

    return $build;