config filtre projet

This commit is contained in:
2023-07-11 22:49:02 +02:00
parent 3bb99038a9
commit c8d33c62ef
5 changed files with 23 additions and 20 deletions
+1 -5
View File
@@ -771,11 +771,7 @@ display:
plugin_id: list_field plugin_id: list_field
operator: or operator: or
value: value:
1: '1' all: all
2: '2'
3: '3'
4: '4'
5: '5'
group: 1 group: 1
exposed: true exposed: true
expose: expose:
+13 -11
View File
@@ -30,6 +30,7 @@ function eql_preprocess_node(&$variables){
$variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste; $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
} }
} }
function eql_preprocess_field(&$variables) { function eql_preprocess_field(&$variables) {
@@ -41,26 +42,22 @@ function eql_preprocess_field(&$variables) {
$type_protagoniste = $node->get('field_type_de_protagoniste')->getString(); $type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
$variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste; $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) { function eql_preprocess_layout__threecol_25_50_25(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node'); $node = \Drupal::routeMatch()->getParameter('node');
$type = $node->gettype(); // $node = &$variables['node'];
// $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
if($type == "projet"){ if($node->gettype() == "projet"){
$variables['content']['top_bottom'] = []; $variables['content']['top_bottom'] = []; /////// déclare les nvx array
$variables['content']['top_right'] = []; $variables['content']['top_right'] = [];
$variables['content']['top_left'] = []; $variables['content']['top_left'] = [];
foreach ($variables['content']['top'] as $key => $value) { 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'){ ////// isset pour voir si existe && si oui fait ce que tu as à faire. $Value c'est l'attribut
if(isset($value['#base_plugin_id']) && $value['#base_plugin_id']== 'entity_field'){
$t = 't';
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") { 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]; $variables['content']['top_bottom'][] = $variables['content']['top'][$key];
unset($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) { // function eql_preprocess_input(&$variables) {
@@ -23,6 +23,7 @@
<div{{ attributes.addClass(classes) }}> <div{{ attributes.addClass(classes) }}>
{% if content.top %} {% if content.top %}
<div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}> <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}>
{{content.top}}
<div class='top_top'> <div class='top_top'>
{{ content.top_left }} {{ content.top_left }}
<div class='top_right'> <div class='top_right'>
@@ -75,10 +75,9 @@
{% {%
set classes = [ set classes = [
'mySlides',
] ]
%} %}
{# <button class="slick-next slick-arrow" aria-label="Next" type="button" style="">Next</button> #}
<article{{ attributes.addClass(classes, 'field__items') }}> <article{{ attributes.addClass(classes, 'field__items') }}>
@@ -102,7 +101,13 @@
{% endif %} {% endif %}
<div{{ content_attributes }}> <div{{ content_attributes }}>
{{ content }} {{content}}
{# <div class='home_actu_infos'>
{{ content.right }}
</div>
<div class='home_actu_photo'>
{{ content.left }}
</div> #}
</div> </div>
</article> </article>
@@ -66,7 +66,6 @@
<div class="view-content"> <div class="view-content">
{{ rows }} {{ rows }}
{# <button class="slick-next slick-arrow" aria-label="Next" type="button" style="">Next</button> #}
</div> </div>
{% elseif empty %} {% elseif empty %}
<div class="view-empty"> <div class="view-empty">