domain_site_settngs + patch

home_mobile with entries
This commit is contained in:
2018-05-02 17:14:31 +02:00
parent f98eaa3836
commit 9e1c24478b
41 changed files with 8927 additions and 208 deletions
@@ -3,7 +3,8 @@
use Drupal\Core\Url;
function template_preprocess_edlp_home(&$vars){
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
$node_view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
$term_view_builder = \Drupal::entityTypeManager()->getViewBuilder('taxonomy_term');
// dpm($vars);
// render the promoted_nodes
@@ -26,14 +27,14 @@ function template_preprocess_edlp_home(&$vars){
$vars['nodes'][] = array(
'vm'=>$vm,
'build'=>$view_builder->view($node, $vm)
'build'=>$node_view_builder->view($node, $vm)
);
}
// render the presentation column
// $vars["presentation"] = array(
// "#type"=>"container",
// "pres"=>$view_builder->view($vars["presentation_node"], 'default'),
// "pres"=>$node_view_builder->view($vars["presentation_node"], 'default'),
// "link"=> array(
// '#title' => t('Visiter la collection sonore.'),
// '#type' => 'link',
@@ -48,7 +49,7 @@ function template_preprocess_edlp_home(&$vars){
// render the last fil column
// $vars["last_fil"] = array(
// "#type" => "container",
// // 'fil' => $view_builder->view($vars['last_fil_node'], 'teaser'),
// // 'fil' => $node_view_builder->view($vars['last_fil_node'], 'teaser'),
// 'title'=> array("#markup" => "<h2 class='title'>Dernier Fil</h2>"),
// 'fil' => $vars['last_fil_node'],
// // 'links' => array(
@@ -80,7 +81,7 @@ function template_preprocess_edlp_home(&$vars){
// render the last production column
// $vars["last_production"] = array(
// '#type' => 'container',
// 'prod' => $view_builder->view($vars['last_production_node'], 'teaser'),
// 'prod' => $node_view_builder->view($vars['last_production_node'], 'teaser'),
// 'link'=> array(
// '#title' => t('Voir toutes les productions.'),
// '#type' => 'link',
@@ -105,8 +106,25 @@ function template_preprocess_edlp_home(&$vars){
);
foreach($vars['agenda_items'] as $node){
$agenda['list']['#items'][] = $view_builder->view($node, 'teaser');
$agenda['list']['#items'][] = $node_view_builder->view($node, 'teaser');
}
$vars['agenda'] = render($agenda);
if(isset($vars['entrees_items'])){
$entrees = array(
'#type'=>"container",
// 'title'=>array(
// '#markup'=>"<h3>".t("Entries")."</h3>",
// ),
'list'=> array(
'#theme' => 'item_list',
'#items' => [],
),
);
foreach($vars['entrees_items'] as $term){
$entrees['list']['#items'][] = $term_view_builder->view($term, 'home_mobile');
}
$vars['entrees'] = render($entrees);
}
}