From c8d33c62ef564aac5c0dd8ced0b756ad8d6102a1 Mon Sep 17 00:00:00 2001 From: ouidade Date: Tue, 11 Jul 2023 22:49:02 +0200 Subject: [PATCH] config filtre projet --- config/sync/views.view.projets.yml | 6 +---- web/themes/custom/eql/eql.theme | 24 ++++++++++--------- .../layout--threecol-25-50-25.html.twig | 1 + ...iew--actus-blocks-pages--block-1.html.twig | 11 ++++++--- ...view-actus-blocks-pages--block-1.html.twig | 1 - 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/config/sync/views.view.projets.yml b/config/sync/views.view.projets.yml index ce234a6..0d86b4e 100644 --- a/config/sync/views.view.projets.yml +++ b/config/sync/views.view.projets.yml @@ -771,11 +771,7 @@ display: plugin_id: list_field operator: or value: - 1: '1' - 2: '2' - 3: '3' - 4: '4' - 5: '5' + all: all group: 1 exposed: true expose: diff --git a/web/themes/custom/eql/eql.theme b/web/themes/custom/eql/eql.theme index 3032a70..ec41b48 100644 --- a/web/themes/custom/eql/eql.theme +++ b/web/themes/custom/eql/eql.theme @@ -29,6 +29,7 @@ function eql_preprocess_node(&$variables){ $type_protagoniste = $node->get('field_type_de_protagoniste')->getString(); $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste; } + } @@ -41,26 +42,22 @@ function eql_preprocess_field(&$variables) { $type_protagoniste = $node->get('field_type_de_protagoniste')->getString(); $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste; } - if ($field_name == 'field--name-field-type-de-moa'){ - $type_de_moa = $node->get('field--name-field-type-de-moa')->getString(); - $variables['attributes']['class'][] = 'filtre-projet-' . $type_de_moa; - } } } +//////////// + function eql_preprocess_layout__threecol_25_50_25(&$variables) { $node = \Drupal::routeMatch()->getParameter('node'); - $type = $node->gettype(); - - if($type == "projet"){ - $variables['content']['top_bottom'] = []; + // $node = &$variables['node']; + // $variables['attributes']['class'][] = 'node-type-' . $node->gettype(); + if($node->gettype() == "projet"){ + $variables['content']['top_bottom'] = []; /////// déclare les nvx array $variables['content']['top_right'] = []; $variables['content']['top_left'] = []; foreach ($variables['content']['top'] as $key => $value) { - // // tu fais ce que tu as a faire - if(isset($value['#base_plugin_id']) && $value['#base_plugin_id']== 'entity_field'){ - $t = 't'; + if(isset($value['#base_plugin_id']) && $value['#base_plugin_id']== 'entity_field'){ ////// isset pour voir si existe && si oui fait ce que tu as à faire. $Value c'est l'attribut if($value['#derivative_plugin_id']=="node:field_type_de_moa" || $value['#derivative_plugin_id']=="node:field_adresse"|| $value['#derivative_plugin_id']=="node:field_type_de_projet" || $value['#derivative_plugin_id']=="node:field_etape_du_projet") { $variables['content']['top_bottom'][] = $variables['content']['top'][$key]; unset($variables["content"]["top"][$key]); @@ -78,6 +75,11 @@ function eql_preprocess_layout__threecol_25_50_25(&$variables) { } } +// function eql_preprocess_views_row_plugins(&$variables){ +// $t = 't'; +// } + + ////////////////////////////////////////////////// // function eql_preprocess_input(&$variables) { diff --git a/web/themes/custom/eql/templates/layout--threecol-25-50-25.html.twig b/web/themes/custom/eql/templates/layout--threecol-25-50-25.html.twig index c3cd0ce..07d1568 100644 --- a/web/themes/custom/eql/templates/layout--threecol-25-50-25.html.twig +++ b/web/themes/custom/eql/templates/layout--threecol-25-50-25.html.twig @@ -23,6 +23,7 @@ {% if content.top %}
+ {{content.top}}
{{ content.top_left }}
diff --git a/web/themes/custom/eql/templates/node--view--actus-blocks-pages--block-1.html.twig b/web/themes/custom/eql/templates/node--view--actus-blocks-pages--block-1.html.twig index 0b568b1..89688f1 100644 --- a/web/themes/custom/eql/templates/node--view--actus-blocks-pages--block-1.html.twig +++ b/web/themes/custom/eql/templates/node--view--actus-blocks-pages--block-1.html.twig @@ -75,10 +75,9 @@ {% set classes = [ - 'mySlides', + ] %} -{# #} @@ -102,7 +101,13 @@ {% endif %} - {{ content }} + {{content}} + {#
+ {{ content.right }} +
+
+ {{ content.left }} +
#}
diff --git a/web/themes/custom/eql/templates/views-view-actus-blocks-pages--block-1.html.twig b/web/themes/custom/eql/templates/views-view-actus-blocks-pages--block-1.html.twig index a986b5f..ac3cd7a 100644 --- a/web/themes/custom/eql/templates/views-view-actus-blocks-pages--block-1.html.twig +++ b/web/themes/custom/eql/templates/views-view-actus-blocks-pages--block-1.html.twig @@ -66,7 +66,6 @@
{{ rows }} -{# #}
{% elseif empty %}