big refactoring of mobile version xhich has now a hamburger menu and a link to collection

This commit is contained in:
2018-11-21 12:51:24 +01:00
parent c92c348eee
commit e204a08202
18 changed files with 668 additions and 389 deletions
@@ -4,7 +4,7 @@ use Drupal\Core\Url;
function template_preprocess_edlp_home(&$vars){
$node_view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
$term_view_builder = \Drupal::entityTypeManager()->getViewBuilder('taxonomy_term');
// $term_view_builder = \Drupal::entityTypeManager()->getViewBuilder('taxonomy_term');
// dpm($vars);
// render the promoted_nodes
@@ -34,21 +34,6 @@ function template_preprocess_edlp_home(&$vars){
}
}
// render the presentation column
// $vars["presentation"] = array(
// "#type"=>"container",
// "pres"=>$node_view_builder->view($vars["presentation_node"], 'default'),
// "link"=> array(
// '#title' => t('Visiter la collection sonore.'),
// '#type' => 'link',
// '#url' => Url::fromRoute('<front>', [], array(
// 'attributes' => array(
// 'class' => ['corpus-link', 'ajax-link']
// )
// ))
// )
// );
// render the last fil column
// $vars["last_fil"] = array(
// "#type" => "container",
@@ -81,21 +66,6 @@ function template_preprocess_edlp_home(&$vars){
// // )
// );
// render the last production column
// $vars["last_production"] = array(
// '#type' => 'container',
// 'prod' => $node_view_builder->view($vars['last_production_node'], 'teaser'),
// 'link'=> array(
// '#title' => t('Voir toutes les productions.'),
// '#type' => 'link',
// '#url' => Url::fromRoute('edlp_productions.productions', [], array(
// 'attributes' => array(
// 'class' => ['productions-link', 'ajax-link']
// )
// ))
// )
// );
// render the lasts documents of collection as list
if(isset($vars['lastdocs_items'])){
@@ -156,25 +126,24 @@ function template_preprocess_edlp_home(&$vars){
$vars['agenda'] = render($agenda);
}
if(isset($vars['entrees_items'])){
$entrees = array(
if(isset($vars['collection_link'])){
$collection = array(
'#type'=>"container",
// '#attributes' => array(
// 'id' => array('collection'),
// ),
'#prefix' => '<div id="collection"></div>',
'title'=>array(
'#markup'=>"<h3>".t("Collection")."</h3>",
),
'list'=> array(
'#theme' => 'item_list',
'#items' => [],
),
'#prefix'=> '<h3>',
'#title' => t("Collection"),
'#suffix' => '</h3>',
'#type' => 'link',
'#url' => $vars['collection_link']['url'],
'#options'=>array(
'attributes' => array(
'data-drupal-link-system-path' => $vars['collection_link']['internal_path'],
'class' => array('ajax-link'),
)
)
)
);
foreach($vars['entrees_items'] as $term){
$entrees['list']['#items'][] = $term_view_builder->view($term, 'home_mobile');
}
$vars['entrees'] = render($entrees);
$vars['collection'] = render($collection);
}
}