Merge branch 'master' of gogs-figureslibres.io:bachir/popsu-d9

This commit is contained in:
2021-06-24 21:08:03 +02:00
27 changed files with 1540 additions and 50 deletions

View File

@@ -6,16 +6,22 @@
use Drupal\Core\Template\Attribute;
/* implements template_preprocess_views_view() */
// function popsu_preprocess_views_view(&$vars) {
// $view = $vars['view'];
// kint($view);die();
// }
/* implements template_preprocess_views_view_unformatted() */
function popsu_preprocess_views_view_unformatted(&$variables) {
$view = $variables['view'];
$view = $variables['view'];
if($view->id() == "programmes"){
$rows = $variables['rows'];
foreach ($rows as $id => $row) {
$variables['rows'][$id]['attributes'] = new Attribute();
$c = $variables['rows'][$id]['content']["#row"]->nid;
$variables['rows'][$id]['attributes']->addClass("popsu-node-".$c);
@@ -34,27 +40,32 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
}
}
/*
$rows = $variables['rows'];
$style = $view->style_plugin;
$options = $style->options;
$variables['default_row_class'] = !empty($options['default_row_class']);
*/
/*
foreach ($rows as $id => $row) {
$variables['rows'][$id] = array();
$variables['rows'][$id]['content'] = $row;
$variables['rows'][$id]['attributes'] = new Attribute();
if ($row_class = $view->style_plugin
->getRowClass($id)) {
$variables['rows'][$id]['attributes']
->addClass($row_class);
}
}
*/
};
/* implements template_preprocess_region() */
function popsu_preprocess_region(&$variables) {
if (isset($variables['region'])) {
$variables['attributes']['class'][] = $variables['region'].'_container';
}
// if ($variables['region'] == 'footer_bottom_right') {
// if ($node = \Drupal::routeMatch()->getParameter('node')) {
// $t = $node->getType();
// }
// }
}
// function popsu_preprocess_field(&$variables){
// $v = $variables;
// }
// function popsu_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
// $v = $variables;
// $suggestions[] = 'views_view__headerView';
// }
/**
* Implements hook_preprocess_block().
@@ -104,4 +115,4 @@ function popsu_preprocess_views_view_field(&$variables){
// overwrite the output
$variables['output'] = $link->toRenderable();
}
}
}