removed first draft of fil content type as it will be custom entity composition

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-14 16:34:50 +01:00
parent a34ec91c9c
commit f44e0e753f
7 changed files with 39 additions and 479 deletions
+27 -26
View File
@@ -24,32 +24,33 @@ 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'),
'links' => array(
'#theme' => 'item_list',
'#items' => array(
'link_all' => array(
'#title' => t("Voir tous les fils de l'EP."),
'#type' => 'link',
'#url' => Url::fromRoute('edlp_fils.fils', [], array(
'attributes' => array(
'class' => ['fils-link', 'ajax-link']
)
))
),
// TODO: link posdcast fils
'link_podcast' => array(
'#title' => t("S'abonner au podcast des fils."),
'#type' => 'link',
'#url' => Url::fromRoute('<front>', [], array(
'attributes' => array(
'class' => ['fils-link']
)
))
)
)
)
// 'fil' => $view_builder->view($vars['last_fil_node'], 'teaser'),
'title'=> array("#markup" => "<h2 class='title'>Dernier Fil</h2>"),
'fil' => $vars['last_fil_node'],
// 'links' => array(
// '#theme' => 'item_list',
// '#items' => array(
// 'link_all' => array(
// '#title' => t("Voir tous les fils de l'EP."),
// '#type' => 'link',
// '#url' => Url::fromRoute('edlp_fils.fils', [], array(
// 'attributes' => array(
// 'class' => ['fils-link', 'ajax-link']
// )
// ))
// ),
// // TODO: link posdcast fils
// 'link_podcast' => array(
// '#title' => t("S'abonner au podcast des fils."),
// '#type' => 'link',
// '#url' => Url::fromRoute('<front>', [], array(
// 'attributes' => array(
// 'class' => ['fils-link']
// )
// ))
// )
// )
// )
);
// render the last production column
@@ -30,14 +30,16 @@ class HomeController extends ControllerBase {
$contents["#presentation_node"] = entity_load('node', array_pop($pres_nid));
// last fil
$query = \Drupal::entityQuery('node')
->condition('status', 1)
->condition('type', 'fil')
->sort('created', 'DESC')
->range(0,1);
// $query = \Drupal::entityQuery('node')
// ->condition('status', 1)
// ->condition('type', 'fil')
// ->sort('created', 'DESC')
// ->range(0,1);
//
// $fil = $query->execute();
// $contents["#last_fil_node"] = entity_load('node', array_pop($fil));
$contents["#last_fil_node"] = array('#markup'=>'En développement.');
$fil = $query->execute();
$contents["#last_fil_node"] = entity_load('node', array_pop($fil));
// last production
$query = \Drupal::entityQuery('node')