Skip to main content
2 of 2
added 263 characters in body
Maouna
  • 1.2k
  • 8
  • 11

There are brackets missing:

$nids = $query->execute();

In my block this works:

 public function build() {
   $query = \Drupal::entityQuery('node');
   $nids = $query->execute();

  $build = [
   '#theme' => 'item_list',
   '#items' => $nids,
  ];

 return $build;
}
Maouna
  • 1.2k
  • 8
  • 11