diff --git a/acf-blocks/home/aides-financieres/aides-financieres.php b/acf-blocks/home/aides-financieres/aides-financieres.php new file mode 100755 index 0000000..f916dff --- /dev/null +++ b/acf-blocks/home/aides-financieres/aides-financieres.php @@ -0,0 +1,55 @@ + + + +
+ +
+

+

+
+
+
+ + +

+

+ + + + + + +
+ + + +
+ +
\ No newline at end of file diff --git a/acf-blocks/home/aides-financieres/block.json b/acf-blocks/home/aides-financieres/block.json new file mode 100644 index 0000000..9639b9b --- /dev/null +++ b/acf-blocks/home/aides-financieres/block.json @@ -0,0 +1,20 @@ +{ + "name": "acf/aides-financieres", + "title": "Aides Financières", + "category": "homegrade-page-home", + "multiple": false, + "icon": { + "foreground": "#DF1E1E", + "src": "schedule" + }, + "keywords": [ + "aides financières", + "aide", + "Financières", + "Renolution" + ], + "acf": { + "mode": "auto", + "renderTemplate": "aides-financieres.php" + } +} \ No newline at end of file diff --git a/acf-blocks/home/demarches-administratives/block.json b/acf-blocks/home/demarches-administratives/block.json new file mode 100644 index 0000000..e00dab3 --- /dev/null +++ b/acf-blocks/home/demarches-administratives/block.json @@ -0,0 +1,27 @@ +{ + "name": "acf/demarches-administratives", + "title": "Démarches Administratives", + "category": "homegrade-page-home", + "multiple": false, + "icon": { + "foreground": "#DF1E1E", + "src": "schedule" + }, + "keywords": [ + "Couverture", + "home", + "Accueil", + "Section d'accueil", + "Header" + ], + "supports": { + "align": [ + "full" + ] + }, + "acf": { + "mode": "auto", + "renderTemplate": "demarches-administratives.php" + }, + "align": "full" +} \ No newline at end of file diff --git a/acf-blocks/home/demarches-administratives/demarches-administratives.php b/acf-blocks/home/demarches-administratives/demarches-administratives.php new file mode 100755 index 0000000..640b842 --- /dev/null +++ b/acf-blocks/home/demarches-administratives/demarches-administratives.php @@ -0,0 +1,45 @@ +'; +// print_r($demarches_administratives_links); +// echo ''; + +?> + + +
+ +
+ +
+

+

+

+
+ + +
+
\ No newline at end of file diff --git a/acf-blocks/home/home-header/block.json b/acf-blocks/home/home-header/block.json new file mode 100644 index 0000000..f773d83 --- /dev/null +++ b/acf-blocks/home/home-header/block.json @@ -0,0 +1,27 @@ +{ + "name": "acf/home-header", + "title": "Section d'accueil", + "category": "homegrade-page-home", + "multiple": false, + "icon": { + "foreground": "#DF1E1E", + "src": "schedule" + }, + "keywords": [ + "Couverture", + "home", + "Accueil", + "Section d'accueil", + "Header" + ], + "supports": { + "align": [ + "full" + ] + }, + "acf": { + "mode": "auto", + "renderTemplate": "home-header.php" + }, + "align": "full" +} \ No newline at end of file diff --git a/acf-blocks/home/home-header/home-header.php b/acf-blocks/home/home-header/home-header.php new file mode 100755 index 0000000..c1f5b17 --- /dev/null +++ b/acf-blocks/home/home-header/home-header.php @@ -0,0 +1,20 @@ + + + +
+
+

+ +

+

+ + + +
+
+ +
+
\ No newline at end of file diff --git a/acf-blocks/home/latest-news/block.json b/acf-blocks/home/latest-news/block.json new file mode 100644 index 0000000..74c91c8 --- /dev/null +++ b/acf-blocks/home/latest-news/block.json @@ -0,0 +1,20 @@ +{ + "name": "acf/latest-news", + "title": "Dernières News", + "category": "homegrade-page-home", + "multiple": false, + "icon": { + "foreground": "#DF1E1E", + "src": "welcome-widgets-menus" + }, + "keywords": [ + "News", + "dernières", + "actus", + "latest" + ], + "acf": { + "mode": "auto", + "renderTemplate": "latest-news.php" + } +} \ No newline at end of file diff --git a/acf-blocks/home/latest-news/latest-news.php b/acf-blocks/home/latest-news/latest-news.php new file mode 100644 index 0000000..834e57a --- /dev/null +++ b/acf-blocks/home/latest-news/latest-news.php @@ -0,0 +1,65 @@ + + +
+
+

+

+
+ +
+ 4, + 'post_type' => 'post', + 'orderby' => 'post_date', + 'order' => 'DESC', + 'post_status' => 'publish' // Show only the published posts + ); + $recentNewsPosts = new WP_Query($args); + + // echo '
';
+		// print_r($recentNewsPosts);
+		// echo '
'; + + ?> + + have_posts()) : while ($recentNewsPosts->have_posts()) : $recentNewsPosts->the_post(); ?> + ID, 'full', array('class' => 'card-news__thumbnail')); + $news_type = get_the_terms($post->ID, "news_type") ?? null; + $post_date = get_the_date('j.m.Y', $post->ID) ?? null; + + get_template_part( + 'template-components/cards/card-news', + null, + array( + 'card_variant' => 'activite', + 'post_ID' => $post->ID, + 'post_title' => get_the_title(), + 'post_thumbnail' => $post_thumbnail, + 'news_type' => $news_type, + 'post_date' => $post_date, + ) + ); + ?> + + +
+ '_wp_page_template', + 'meta_value' => "template-archive-news.php" + ); + $relatedPageTemplatePage = get_pages($args) ? get_pages($args)[0] : null; + ?> + + + + + +
\ No newline at end of file diff --git a/acf-blocks/home/questions-frequentes/block.json b/acf-blocks/home/questions-frequentes/block.json new file mode 100644 index 0000000..9af4ef7 --- /dev/null +++ b/acf-blocks/home/questions-frequentes/block.json @@ -0,0 +1,17 @@ +{ + "name": "acf/questions-frequentes", + "title": "Questions Fréquentes", + "category": "homegrade-page-home", + "multiple": false, + "icon": { + "foreground": "#DF1E1E", + "src": "schedule" + }, + "keywords": [ + "Questions Fréquentes" + ], + "acf": { + "mode": "auto", + "renderTemplate": "questions-frequentes.php" + } +} \ No newline at end of file diff --git a/acf-blocks/home/questions-frequentes/questions-frequentes.php b/acf-blocks/home/questions-frequentes/questions-frequentes.php new file mode 100644 index 0000000..0738956 --- /dev/null +++ b/acf-blocks/home/questions-frequentes/questions-frequentes.php @@ -0,0 +1,72 @@ + 1, + 'post_status' => 'publish', + 'post_type' => 'questions', + 'include_children' => true, + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'slug', + 'terms' => $post_thematique->slug, + 'include_children' => true, + ) + ) + + ); + $posts = new WP_Query($automatic_query_args); + return $posts->posts[0] ?? null; + } +} + +?> + +
+
+

+

+
+
+ 'thematiques', + 'hide_empty' => false, + 'parent' => 0 + )); + + foreach ($thematique_terms as $key => $thematique) { + if ( + $thematique->slug === "renovation-circulaire" + || $thematique->slug === "circulaire-renovatie" + || $thematique->slug === "au-quotidien" + || $thematique->slug === "dagelijks" + || $thematique->slug === "aides-financieres" + || $thematique->slug === "financiele-steun" + ) continue; + + // $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques'); + + $manual_data = get_field($thematique->slug . '_manual_data'); + $post_datas = $manual_data ? $manual_data : get_automatic_post($thematique); + + get_template_part( + 'template-components/cards/card-frequent-question', + null, + array( + 'thematique' => $thematique, + 'post_ID' => $post_datas->ID, + 'post_title' => $post_datas->post_title, + 'post_excerpt' => $post_datas->post_excerpt, + // 'post_url' => $post_datas->post_excerpt, + ) + ); + } + ?> +
+ +
\ No newline at end of file diff --git a/acf-blocks/home/show-thematiques/block.json b/acf-blocks/home/show-thematiques/block.json new file mode 100644 index 0000000..08f9ef2 --- /dev/null +++ b/acf-blocks/home/show-thematiques/block.json @@ -0,0 +1,17 @@ +{ + "name": "acf/show-thematiques", + "title": "Thématiques", + "category": "homegrade-page-home", + "multiple": false, + "icon": { + "foreground": "#DF1E1E", + "src": "schedule" + }, + "keywords": [ + "Thématiques" + ], + "acf": { + "mode": "auto", + "renderTemplate": "show-thematiques.php" + } +} \ No newline at end of file diff --git a/acf-blocks/home/show-thematiques/show-thematiques.js b/acf-blocks/home/show-thematiques/show-thematiques.js new file mode 100644 index 0000000..d5e57c3 --- /dev/null +++ b/acf-blocks/home/show-thematiques/show-thematiques.js @@ -0,0 +1,65 @@ +window.addEventListener("DOMContentLoaded", (event) => { + const cardThematiques = document.querySelectorAll(".swiper-slide .card-thematique"); + + function swiperCheckBreakpoints() { + const hasSwiper = thematiquesSwiper.__swiper__ === true; + + if (window.innerWidth < 960 && hasSwiper) { + thematiquesSwiper.destroy(true, true); + } + if (window.innerWidth >= 960 && !hasSwiper) { + initiateSwiper(); + } + } + + function initiateSwiper() { + thematiquesSwiper = new Swiper(".swiper-container", { + grabCursor: false, + slidesPerView: 3, + spaceBetween: 30, + a11y: { + enabled: true, + prevSlideMessage: textTranslations.previousSlide, + nextSlideMessage: textTranslations.nextSlide, + slideRole: "", + slideLabelMessage: textTranslations.slideLabel, + }, + // loop: true, + // centeredSlides: true, + keyboard: { + enabled: true, + }, + navigation: { + nextEl: ".thematique-button-next", + prevEl: ".thematique-button-prev", + }, + pagination: { + el: ".swiper-pagination", + clickable: true, + renderBullet: function (index, className) { + const ariaLabel = cardThematiques[index].getAttribute("data-taxonomy"); + + // return ``; + return `
`; + }, + }, + breakpoints: { + // when window width is >= 320px + + // when window width is >= 480px + 320: { + slidesPerView: 2, + }, + // when window width is >= 640px + 1100: { + slidesPerView: 3, + }, + }, + // a11y: false, + }); + } + initiateSwiper(); + swiperCheckBreakpoints(); + + window.addEventListener("resize", swiperCheckBreakpoints); +}); diff --git a/acf-blocks/home/show-thematiques/show-thematiques.php b/acf-blocks/home/show-thematiques/show-thematiques.php new file mode 100755 index 0000000..d7efe1f --- /dev/null +++ b/acf-blocks/home/show-thematiques/show-thematiques.php @@ -0,0 +1,79 @@ + 'thematiques', + 'parent' => 0, + 'hide_empty' => false, +)); + +?> + +
+ +
+

+

+
+ +
+ + + + +
+ + + + +
+ + + + + slug === "renovation-circulaire" + || $term->slug === "circulaire-renovatie" + || $term->slug === "au-quotidien" + || $term->slug === "dagelijks" + || $term->slug === "aides-financieres" + || $term->slug === "financiele-steun" + + ) continue; ?> +
+ $term, + ) + ); + ?> +
+ + +
+ +
+ + + + +
+ + + + +
+ + + +
\ No newline at end of file