Quellcode durchsuchen

affiachage resosurces

ouidade vor 1 Woche
Ursprung
Commit
3ea33a596b

+ 26 - 21
web/themes/custom/eql/dist/assets/css/bundle.css

@@ -5634,29 +5634,34 @@ svg.ext {
   right: 15%;
 }
 
-.page-node-type-ressource .type-les-projets-en-images .block-region-top {
+.carousel {
+  display: none;
+}
+
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top {
   display: flex !important;
   flex-direction: column;
   margin-left: 11%;
 }
 @media screen and (min-width: 1100px) {
-  .page-node-type-ressource .type-les-projets-en-images .block-region-top {
+  .page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top {
     display: flex;
   }
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block {
   margin-left: 0;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images {
   padding: 0;
   order: 7;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel {
+  display: block;
   max-width: 60vw;
   margin: auto;
   text-align: center;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container {
   position: relative;
   height: 500px;
   max-height: 500px;
@@ -5664,16 +5669,16 @@ svg.ext {
   width: 100%;
   object-fit: contain;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container img {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container img {
   width: 100%;
   height: 100%;
   object-fit: contain;
   transition: transform 0.3s ease-in-out;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container img.animate {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container img.animate {
   transform: scale(1.02);
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container .arrow {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container .arrow {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
@@ -5683,17 +5688,17 @@ svg.ext {
   color: white;
   cursor: pointer;
 }
-content .page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container .arrow.left {
+content .page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container .arrow.left {
   left: 10px;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container .arrow.right {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .main-image-container .arrow.right {
   right: 10px;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .caption {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .caption {
   margin-top: 10px;
   font-family: sans-serif;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper {
   position: relative;
   max-width: 100%;
   overflow: hidden;
@@ -5701,7 +5706,7 @@ content .page-node-type-ressource .type-les-projets-en-images .block-region-top
   align-items: center;
   justify-content: center;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumb-arrow {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumb-arrow {
   cursor: pointer;
   padding: 5px 10px;
   background: #00aaff;
@@ -5710,13 +5715,13 @@ content .page-node-type-ressource .type-les-projets-en-images .block-region-top
   user-select: none;
   z-index: 2;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumb-arrow.left {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumb-arrow.left {
   margin-right: 10px;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumb-arrow.right {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumb-arrow.right {
   margin-left: 10px;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails {
   display: flex;
   gap: 10px;
   overflow-x: auto;
@@ -5725,20 +5730,20 @@ content .page-node-type-ressource .type-les-projets-en-images .block-region-top
   padding: 10px 0;
   scrollbar-width: none;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails::-webkit-scrollbar {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails::-webkit-scrollbar {
   display: none;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails img {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails img {
   width: 60px;
   height: 60px;
   object-fit: cover;
   border: 2px solid transparent;
   cursor: pointer;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails img.active {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .carousel .thumbnails-wrapper .thumbnails img.active {
   border-color: #00aaff;
 }
-.page-node-type-ressource .type-les-projets-en-images .block-region-top .block-entity-fieldnodefield-images .field__items {
+.page-node-type-ressource .type-les-projets-en-images.layout__region--top .block-region-top .block-entity-fieldnodefield-images .field__items {
   display: none;
 }
 

+ 11 - 8
web/themes/custom/eql/eql.theme

@@ -146,15 +146,18 @@ function eql_preprocess_layout__threecol_25_50_25(&$variables) {
     if ($node->hasField('field_type_de_ressource') && !$node->get('field_type_de_ressource')->isEmpty()) {
       $terms = $node->get('field_type_de_ressource')->referencedEntities();
       if (!empty($terms)) {
-        $label = $terms[0]->label();
-        $css_class = 'type-' . Html::cleanCssIdentifier(strtolower($label));
-
-        // Appliquer cette classe à la région "top"
-        if (!isset($variables['region_attributes']['top'])) {
-          $variables['region_attributes']['top'] = new \Drupal\Core\Template\Attribute();
+        foreach ($terms as $term) {
+          if ($term instanceof \Drupal\taxonomy\Entity\Term) {
+            $label = $term->label();
+            $css_class = 'type-' . \Drupal\Component\Utility\Html::cleanCssIdentifier(strtolower($label));
+      
+            if (!isset($variables['region_attributes']['top'])) {
+              $variables['region_attributes']['top'] = new \Drupal\Core\Template\Attribute();
+            }
+      
+            $variables['region_attributes']['top']->addClass($css_class);
+          }
         }
-
-        $variables['region_attributes']['top']->addClass($css_class);
       }
     }
   }

+ 5 - 2
web/themes/custom/eql/scss/pages/_ressource-type-en-images.scss

@@ -1,7 +1,8 @@
-
+.carousel{display: none;}
 .page-node-type-ressource{
 
-        .type-les-projets-en-images .block-region-top{
+        .type-les-projets-en-images.layout__region--top{
+            .block-region-top{
             display: flex !important;
             flex-direction: column;
             margin-left: 11%;
@@ -16,6 +17,7 @@
                 order: 7;
 
                 .carousel {
+                    display: block;
                     max-width: 60vw;
                     margin: auto;
                     text-align: center;
@@ -144,4 +146,5 @@
         }
 
     // }
+    }
 }    

+ 1 - 1
web/themes/custom/eql/scss/partials/_node-type-ressource-teaser.scss

@@ -70,7 +70,7 @@ article.node-type-ressource{
             }
         }
     }
-    &.type-de-ressource-Paroles-de-lauréats{
+    &.type-paroles-de-laureats{
         // background-color: $background-actus;
     }
     @media (max-width: 479px) {

+ 30 - 0
web/themes/custom/eql/templates/partials/select.html.twig

@@ -0,0 +1,30 @@
+{#
+/**
+ * @file
+ * Default theme implementation for a select element.
+ *
+ * Available variables:
+ * - attributes: HTML attributes for the <select> tag.
+ * - options: The <option> element children.
+ *
+ * @see template_preprocess_select()
+ *
+ * @ingroup themeable
+ */
+#}
+{% apply spaceless %}
+  <select{{ attributes }}>
+    {% for option in options %}
+      {% if option.type == 'optgroup' %}
+        <optgroup label="{{ option.label }}">
+          {% for sub_option in option.options %}
+            <option value="{{ sub_option.value }}"{{ sub_option.selected ? ' selected="selected"' }}>{{ sub_option.label }}</option>
+          {% endfor %}
+        </optgroup>
+      {% elseif option.type == 'option' %}
+        <option value="{{ option.value }}"{{ option.selected ? ' selected="selected"' }}>{{ option.label }}</option>
+      {% endif %}
+    {% endfor %}
+  </select>
+{% endapply %}
+