|
@@ -9,27 +9,31 @@ function template_preprocess_edlp_agenda(&$vars){
|
|
|
*/
|
|
|
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
|
|
|
|
|
|
- $vars['next_event'] = array(
|
|
|
- "#markup"=>"<h3>Prochaine Date</h3>",
|
|
|
- "event"=>$view_builder->view($vars['next_event_node'], 'default')
|
|
|
- );
|
|
|
-
|
|
|
- $future_list = array (
|
|
|
- '#theme' => 'item_list',
|
|
|
- '#items' => [],
|
|
|
- );
|
|
|
- foreach($vars['coming_events_nodes'] as $node){
|
|
|
- $future_list['#items'][] = $view_builder->view($node, 'teaser');
|
|
|
+ if(isset($vars['next_event_node'])){
|
|
|
+ $vars['next_event'] = array(
|
|
|
+ "#markup"=>"<h3>Prochaine Date</h3>",
|
|
|
+ "event"=>$view_builder->view($vars['next_event_node'], 'default')
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
- $vars['coming_events'] = array(
|
|
|
- "#type"=>"container",
|
|
|
- "#attributes"=>array(
|
|
|
- "class"=>['future-events']
|
|
|
- ),
|
|
|
- "#markup"=>"<h3>".t("Upcoming Events")."</h3>",
|
|
|
- "future_events"=>$future_list
|
|
|
- );
|
|
|
+ if(count($vars['coming_events_nodes'])){
|
|
|
+ $future_list = array (
|
|
|
+ '#theme' => 'item_list',
|
|
|
+ '#items' => [],
|
|
|
+ );
|
|
|
+ foreach($vars['coming_events_nodes'] as $node){
|
|
|
+ $future_list['#items'][] = $view_builder->view($node, 'teaser');
|
|
|
+ }
|
|
|
+
|
|
|
+ $vars['coming_events'] = array(
|
|
|
+ "#type"=>"container",
|
|
|
+ "#attributes"=>array(
|
|
|
+ "class"=>['future-events']
|
|
|
+ ),
|
|
|
+ "#markup"=>"<h3>".t("Upcoming Events")."</h3>",
|
|
|
+ "future_events"=>$future_list
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
|
|
|
$past_list = array (
|