edlp_home.inc 790 B

1234567891011121314151617181920212223242526272829
  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"] = array(
  7. $view_builder->view($vars["presentation_node"], 'default')
  8. );
  9. // render the last fil node
  10. $vars["last_fil"] = $view_builder->view($vars['last_fil_node'], 'teaser');
  11. // render the last production node
  12. $vars["last_production"] = $view_builder->view($vars['last_production_node'], 'teaser');
  13. // render the next events of agenda as list
  14. $agenda = array (
  15. '#theme' => 'item_list',
  16. '#items' => [],
  17. );
  18. foreach($vars['agenda_items'] as $node){
  19. $agenda['#items'][] = $view_builder->view($node, 'teaser');
  20. }
  21. $vars['agenda'] = render($agenda);
  22. }