This commit is contained in:
armansansd 2021-10-18 13:00:56 +02:00
parent 3b008b5a74
commit dd4d9df8e5
3 changed files with 32 additions and 38 deletions

File diff suppressed because one or more lines are too long

View File

@ -42,6 +42,15 @@ function popsu_preprocess_field(&$variables){
if ($element['#field_name'] == 'field_texte') { if ($element['#field_name'] == 'field_texte') {
$variables['attributes']['class'][] = 'crop'; $variables['attributes']['class'][] = 'crop';
} }
if($element["#field_name"] == "field_programme"){
foreach ($variables["items"] as $id => $item) {
$item['attributes']['class'] = new Attribute();
$c = $item['content']['#options']['entity']->nid->getString();
$item['attributes']->addClass("programme-".$c);
// kint($variables["items"]);die();
}
}
} }
} }

View File

@ -2,42 +2,28 @@
.field_logo{ .field_logo{
display: block; display: block;
} }
&.programme-1{ .field_programme>div{
// .field_programme{ &.programme-1{
// background: $col-1; background: $col-1;
// } }
&.programme-2{
} background: $col-2;
&.programme-2{ }
// .field_programme{ &.programme-3{
// background: $col-2; background: $col-eur;
// } }
} &.programme-4{
&.programme-3{ background: $col-1;
}
// .field_programme{ &.programme-5{
// background: $col-eur; background: $col-mond;
// } }
} &.programme-6{
&.programme-4{ background: $col-ter;
// .field_programme{ }
// background: $col-1; &.programme-7{
// } background: $col-met;
} }
&.programme-5{
// .field_programme{
// background: $col-mond;
// }
}
&.programme-6{
// .field_programme{
// background: $col-ter;
// }
}
&.programme-7{
// .field_programme{
// background: $col-met;
// }
} }
.block-region-first{ .block-region-first{
padding: 1rem; padding: 1rem;
@ -83,7 +69,6 @@
color: white; color: white;
font-weight: 600; font-weight: 600;
padding: .3rem .5rem; padding: .3rem .5rem;
background-color: red;
margin-right: .5rem; margin-right: .5rem;
margin-bottom: .5rem; margin-bottom: .5rem;
} }