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
operator: or
value:
1: '1'
2: '2'
3: '3'
4: '4'
5: '5'
all: all
group: 1
exposed: true
expose:
+13 -11
View File
@@ -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) {
@@ -23,6 +23,7 @@
<div{{ attributes.addClass(classes) }}>
{% if content.top %}
<div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}>
{{content.top}}
<div class='top_top'>
{{ content.top_left }}
<div class='top_right'>
@@ -75,10 +75,9 @@
{%
set classes = [
'mySlides',
]
%}
{# <button class="slick-next slick-arrow" aria-label="Next" type="button" style="">Next</button> #}
<article{{ attributes.addClass(classes, 'field__items') }}>
@@ -102,7 +101,13 @@
{% endif %}
<div{{ content_attributes }}>
{{ content }}
{{content}}
{# <div class='home_actu_infos'>
{{ content.right }}
</div>
<div class='home_actu_photo'>
{{ content.left }}
</div> #}
</div>
</article>
@@ -66,7 +66,6 @@
<div class="view-content">
{{ rows }}
{# <button class="slick-next slick-arrow" aria-label="Next" type="button" style="">Next</button> #}
</div>
{% elseif empty %}
<div class="view-empty">