created lastdocs home block and corresponfing page

This commit is contained in:
2018-09-14 16:04:48 +02:00
parent 03ab172f42
commit 6ca52c635e
23 changed files with 479 additions and 19 deletions
@@ -93,6 +93,34 @@ function template_preprocess_edlp_home(&$vars){
// )
// );
// render the lasts documents of collection as list
$lastdocs_url = Url::fromRoute('edlp_corpus.lastdocs');
$lastdocs = array(
'#type'=>"container",
'title'=>array(
'#prefix'=> '<h3>',
'#title' => t("Last documents"),
'#suffix' => '</h3>',
'#type' => 'link',
'#url' => $lastdocs_url,
'#options'=>array(
'attributes' => array(
'data-drupal-link-system-path' => $lastdocs_url->getInternalPath(),
'class' => array('ajax-link'),
)
)
),
'list'=> array(
'#theme' => 'item_list',
'#items' => [],
),
);
foreach($vars['lastdocs_items'] as $node){
$lastdocs['list']['#items'][] = $node_view_builder->view($node, 'search_index');
}
$vars['lastdocs'] = render($lastdocs);
// render the next events of agenda as list
$agenda_url = Url::fromRoute('edlp_agenda.agenda');
$agenda = array(