page popsu couleur et logo

This commit is contained in:
armansansd
2021-08-09 17:57:49 +02:00
parent de700b385f
commit 958324cb7a
10 changed files with 485 additions and 294 deletions

View File

@@ -7,7 +7,31 @@
use Drupal\Core\Template\Attribute;
/* implements template_preprocess_views_view_unformatted() */
// /* implements template_preprocess_html() */
// function popsu_preprocess_page(&$variables) {
// //var_dump($variables);
// // $variables['attributes']['class'][] = 'pouette';
// //pour page popsu :
// $nid = $variables['node']->nid->getString();
// //$variables['attributes']['class'][] = 'programme-'.$nid;
// //kint($nid);
// //pour popsu : - fetch nid
// }
function popsu_preprocess_html(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
if ($node){
if($node->hasField('field_programme') && $node->get('field_programme')->getString() != ""){
$variables['attributes']['class'][] = 'programme-' . $node->get('field_programme')->getString();
}else{
if ($node->id()){
$variables['attributes']['class'][] = 'programme-' . $node->id();
}
}
}
}
function popsu_preprocess_views_view_unformatted(&$variables) {