added last fil to edlp_home
This commit is contained in:
@@ -6,9 +6,12 @@ function template_preprocess_edlp_home(&$vars){
|
|||||||
// dpm($vars);
|
// dpm($vars);
|
||||||
|
|
||||||
// render the presentation node
|
// render the presentation node
|
||||||
$vars["presentation"] = $view_builder->view($vars["presentation_node"], 'default');
|
$vars["presentation"] = array(
|
||||||
|
$view_builder->view($vars["presentation_node"], 'default')
|
||||||
|
);
|
||||||
|
|
||||||
// TODO: last fil
|
// render the last fil node
|
||||||
|
$vars["last_fil"] = $view_builder->view($vars['last_fil_node'], 'teaser');
|
||||||
|
|
||||||
// render the last production node
|
// render the last production node
|
||||||
$vars["last_production"] = $view_builder->view($vars['last_production_node'], 'teaser');
|
$vars["last_production"] = $view_builder->view($vars['last_production_node'], 'teaser');
|
||||||
|
|||||||
@@ -28,17 +28,23 @@ class HomeController extends ControllerBase {
|
|||||||
$pres_nid = $query->execute();
|
$pres_nid = $query->execute();
|
||||||
$contents["#presentation_node"] = entity_load('node', array_pop($pres_nid));
|
$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);
|
||||||
|
|
||||||
// TODO: last fil
|
$fil = $query->execute();
|
||||||
// $contents["#last_fil_node"] = "Last Fil";
|
$contents["#last_fil_node"] = entity_load('node', array_pop($fil));
|
||||||
|
|
||||||
// TODO: last production
|
// last production
|
||||||
$query = \Drupal::entityQuery('node')
|
$query = \Drupal::entityQuery('node')
|
||||||
->condition('status', 1)
|
->condition('status', 1)
|
||||||
->condition('type', 'page')
|
->condition('type', 'page')
|
||||||
->condition('field_page_type', array('1168'), 'NOT IN')
|
->condition('field_page_type', array('1168'), 'NOT IN')
|
||||||
->range(0,1)
|
->sort('created', 'DESC')
|
||||||
->sort('created', 'DESC');
|
->range(0,1);
|
||||||
|
|
||||||
$prod = $query->execute();
|
$prod = $query->execute();
|
||||||
$contents["#last_production_node"] = entity_load('node', array_pop($prod));
|
$contents["#last_production_node"] = entity_load('node', array_pop($prod));
|
||||||
|
|||||||
Reference in New Issue
Block a user