edlp_home.inc 688 B

1234567891011121314151617181920212223242526
  1. <?php
  2. function template_preprocess_edlp_home(&$vars){
  3. $view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
  4. // dpm($vars);
  5. // render the presentation node
  6. $vars["presentation"] = $view_builder->view($vars["presentation_node"], 'default');
  7. // TODO: last fil
  8. // render the last production node
  9. $vars["last_production"] = $view_builder->view($vars['last_production_node'], 'teaser');
  10. // render the next events of agenda as list
  11. $agenda = array (
  12. '#theme' => 'item_list',
  13. '#items' => [],
  14. );
  15. foreach($vars['agenda_items'] as $node){
  16. $agenda['#items'][] = $view_builder->view($node, 'teaser');
  17. }
  18. $vars['agenda'] = render($agenda);
  19. }