modification - mail 23/08
This commit is contained in:
@@ -7,16 +7,8 @@
|
||||
use Drupal\Core\Template\Attribute;
|
||||
|
||||
|
||||
// /* 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_views_view_list(&$variables){
|
||||
// kint($variables);die();
|
||||
// }
|
||||
|
||||
function popsu_preprocess_html(&$variables) {
|
||||
@@ -35,9 +27,8 @@ function popsu_preprocess_html(&$variables) {
|
||||
|
||||
function popsu_preprocess_field(&$variables){
|
||||
$element = &$variables['element'];
|
||||
// $items = &$variables['items'];
|
||||
if (isset($element['#field_name'])) {
|
||||
// kint($element['#field_name']);
|
||||
|
||||
$variables['attributes']['class'][] = $element['#field_name'];
|
||||
if ($element['#field_name'] == 'field_texte') {
|
||||
$variables['attributes']['class'][] = 'crop';
|
||||
@@ -67,7 +58,6 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
|
||||
$variables['rows'][$id]['attributes']->addClass("programme-".$c);
|
||||
if ($entity->hasField('field_type_de_ressource') && $entity->get('field_type_de_ressource')->getString() == "74" ) {
|
||||
$type = $entity->get('field_type_de_ressource')->getString();
|
||||
// $variables['rows'][$id]['attributes'] = new Attribute();
|
||||
$variables['rows'][$id]['attributes']['class'][] = "type-".$type;
|
||||
}
|
||||
}
|
||||
@@ -77,7 +67,7 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
|
||||
$c = $r->get('field_programme')->getString();
|
||||
$variables['rows'][$id]['attributes'] = new Attribute();
|
||||
$variables['rows'][$id]['attributes']->addClass("programme-".$c);
|
||||
// kint($c);die();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -214,6 +204,4 @@ function popsu_preprocess_block__entity_field(&$variables){
|
||||
|
||||
|
||||
}
|
||||
// if($items->isEmpty()){
|
||||
// }
|
||||
}
|
Reference in New Issue
Block a user