From d52f392cbd282e4add3f5b6c5a611d2b7a6dcecb Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 13 Jun 2023 16:42:59 +0200 Subject: [PATCH] Adding questions frequents & demarches administrative blocks to homepage --- css/app.css | 151 ++++++++++++-- includes/blocks.php | 2 + includes/init.php | 2 +- includes/post_types.php | 2 +- includes/taxonomy.php | 35 ++-- includes/utilities.php | 13 ++ resources/css/app.css | 4 + .../css/components/card-large-content.css | 37 +++- resources/css/components/cta.css | 2 +- resources/css/components/section-titling.css | 5 + ...ustration-que-fait-homegrade-pour-vous.svg | 185 ++++++++++++++++++ .../img/pictogrammes/pictogramme-FAQ.svg | 56 ++++++ .../img/pictogrammes/pictogramme-contact.svg | 37 ++++ .../img/pictogrammes/pictogramme-outils.svg | 28 +++ .../img/pictogrammes/pictogramme-services.svg | 56 ++++++ .../aides-financieres/aides-financieres.css | 1 - .../aides-financieres/aides-financieres.php | 4 +- .../home/aides-financieres/block.json | 2 +- .../home/aides-financieres/coins.svg | 1 - .../home/aides-financieres/coins2.svg | 1 - .../home/demarches-administratives/block.json | 27 +++ .../demarches-administratives.css | 15 ++ .../demarches-administratives.php | 48 +++++ template-blocks/home/home-header/block.json | 10 +- template-blocks/home/latest-news/block.json | 2 +- .../home/questions-frequentes/block.json | 17 ++ .../questions-frequentes.css | 7 + .../questions-frequentes.php | 45 +++++ .../home/show-thematiques/block.json | 2 +- .../card-frequent-question.php | 22 +++ .../card-frequent_question.css | 19 ++ 31 files changed, 795 insertions(+), 43 deletions(-) create mode 100644 resources/img/illustrations/illustration-que-fait-homegrade-pour-vous.svg create mode 100644 resources/img/pictogrammes/pictogramme-FAQ.svg create mode 100644 resources/img/pictogrammes/pictogramme-contact.svg create mode 100644 resources/img/pictogrammes/pictogramme-outils.svg create mode 100644 resources/img/pictogrammes/pictogramme-services.svg delete mode 100755 template-blocks/home/aides-financieres/coins.svg delete mode 100644 template-blocks/home/aides-financieres/coins2.svg create mode 100644 template-blocks/home/demarches-administratives/block.json create mode 100755 template-blocks/home/demarches-administratives/demarches-administratives.css create mode 100755 template-blocks/home/demarches-administratives/demarches-administratives.php create mode 100644 template-blocks/home/questions-frequentes/block.json create mode 100644 template-blocks/home/questions-frequentes/questions-frequentes.css create mode 100644 template-blocks/home/questions-frequentes/questions-frequentes.php create mode 100644 template-components/card-frequent-question.php create mode 100644 template-components/card-frequent_question.css diff --git a/css/app.css b/css/app.css index 61958e6..8727804 100644 --- a/css/app.css +++ b/css/app.css @@ -1005,10 +1005,13 @@ body:not(.wp-admin) { width: -moz-fit-content; width: fit-content; border-radius: 9999px; - padding-left: 2.5rem; - padding-right: 2.5rem; + padding-left: 2rem; + padding-right: 2rem; padding-top: 1rem; padding-bottom: 1rem; + font-size: 1rem; + line-height: 1.5rem; + font-weight: 700; } .cta--primary { @@ -1066,15 +1069,72 @@ body:not(.wp-admin) { line-height: 1.1; } +.card-large-content-container { + display: flex; + flex-direction: column; + align-items: center; + background-color: rgb(239, 239, 239, 0.6); + padding-top: 4rem; + padding-bottom: 4rem; +} + +.card-large-content-container--has-illustration { + padding-top: 12rem; +} + .card-large-content { + position: relative; width: 100%; - max-width: 1280px; + max-width: 1440px; border-radius: 1.5rem; --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); padding: 4rem; } +.card-large-content--has-illustration { + padding-top: 10rem; +} + +.card-large-content__top-illustration { + position: absolute; + top: 0px; + left: 50%; + transform: translate(-50%, -50%); +} + +.card-large-content__links-container { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 3rem; +} + +.card-large-content__link { + margin-top: 2rem; + font-size: 1.5rem; + line-height: 2rem; +} + +.card-large-content__link__page_icon { + max-width: 80px; +} + +.card-large-content__link__title { + margin-top: 0.75rem; + font-size: 1.25rem; + font-weight: 700; +} + +.card-large-content__link__excerpt { + padding-top: 0.75rem; + font-size: 1.125rem; + line-height: 1.75rem; +} + +.card-large-content__link .cta { + margin-top: 2rem; +} + .section_titling { padding-bottom: 2rem; text-align: center; @@ -1091,6 +1151,9 @@ body:not(.wp-admin) { } .section_titling__subtitle { + margin-left: auto; + margin-right: auto; + max-width: 48rem; font-size: 2.25rem; line-height: 2.5rem; font-weight: 700; @@ -1098,6 +1161,47 @@ body:not(.wp-admin) { color: rgb(0 0 0 / var(--tw-text-opacity)); } +.section_titling__description { + margin-left: auto; + margin-right: auto; + max-width: 48rem; + padding-top: 1rem; + font-size: 1.125rem; + line-height: 1.75rem; +} + +.card-frequent-question { + border-radius: 1.5rem; + padding: 2rem; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} + +.card-frequent-question__icon { + max-width: 80px; +} + +.card-frequent-question__title { + margin-top: 1rem; + padding-bottom: 1rem; + font-size: 1.25rem; + font-weight: 700; +} + +.card-frequent-question__tags_container { + display: flex; + flex-wrap: wrap; + -moz-column-gap: 0.75rem; + column-gap: 0.75rem; +} + +.card-frequent-question__tags_container .tag { + border-radius: 0.5rem; + padding-top: 0.25rem; + padding-bottom: 0.25rem; + padding-left: 1rem; + padding-right: 1rem; +} + /* ########### LAYOUT ############ */ .primary-menu-container { @@ -1701,15 +1805,6 @@ article > *:not(.entry-content), padding-bottom: 4rem; } -#block-aides-financieres { - display: flex; - flex-direction: column; - align-items: center; - background-color: rgb(239, 239, 239, 0.6); - padding-top: 4rem; - padding-bottom: 4rem; -} - #block-aides-financieres .section_titling { max-width: 782px; } @@ -1906,6 +2001,38 @@ article > *:not(.entry-content), hue-rotate(263deg) brightness(99%) contrast(96%); } +#block-demarches-administratives.card-large-content-container--has-illustration { + padding-top: 16rem; +} + +#block-demarches-administratives .card-large-content--has-illustration { + padding-top: 7rem; +} + +#block-demarches-administratives .card-large-content__top-illustration { + transform: translate(-50%, -70%); +} + +#block-demarches-administratives .card-large-content__links-container { + grid-template-columns: repeat(4, minmax(0, 1fr)); +} + +#block-questions-frequentes { + padding-top: 7rem; + padding-bottom: 7rem; +} + +.questions-frequentes-grid { + margin-left: auto; + margin-right: auto; + display: grid; + max-width: 1280px; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 2rem; + -moz-column-gap: 2rem; + column-gap: 2rem; +} + /* ########### UTILITIES ############ */ .shadowed { diff --git a/includes/blocks.php b/includes/blocks.php index e276ff0..2f15b6c 100755 --- a/includes/blocks.php +++ b/includes/blocks.php @@ -41,6 +41,8 @@ function mywp_register_acf_blocks() register_block_type(get_template_directory() . '/template-blocks/home/latest-news'); register_block_type(get_template_directory() . '/template-blocks/home/show-thematiques'); register_block_type(get_template_directory() . '/template-blocks/home/aides-financieres'); + register_block_type(get_template_directory() . '/template-blocks/home/demarches-administratives'); + register_block_type(get_template_directory() . '/template-blocks/home/questions-frequentes'); } add_action('init', 'mywp_register_acf_blocks'); diff --git a/includes/init.php b/includes/init.php index 13a49b8..ed67398 100644 --- a/includes/init.php +++ b/includes/init.php @@ -37,7 +37,7 @@ function tailpress_setup() add_theme_support('editor-styles'); add_editor_style('css/editor-style.css'); add_theme_support('widgets'); - // add_post_type_support( 'page', 'excerpt' ); + add_post_type_support('page', 'excerpt'); } add_action('after_setup_theme', 'tailpress_setup'); diff --git a/includes/post_types.php b/includes/post_types.php index 7c73b94..80cd0b2 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -60,7 +60,7 @@ function create_posttype() 'menu_icon' => 'dashicons-editor-help', 'menu_position' => 4, - 'supports' => array('title', 'custom-fields'), + 'supports' => array('title', 'custom-fields', 'excerpt'), ) ); register_post_type( diff --git a/includes/taxonomy.php b/includes/taxonomy.php index 3f25054..c973be4 100644 --- a/includes/taxonomy.php +++ b/includes/taxonomy.php @@ -43,7 +43,7 @@ function add_custom_taxonomies() register_taxonomy('thematiques', ['fiche-questions', 'fiche-conseils'], array( // 'hierarchical' => true, 'labels' => array( - 'name' => _x('Thématiques', 'taxonomy general name'), + 'name' => _x('Thématiquesssse', 'taxonomy general name'), 'singular_name' => _x('Thématique', 'taxonomy singular name'), 'search_items' => __('Chercher une Thématique'), 'all_items' => __('Toutes les Thématiques'), @@ -55,6 +55,9 @@ function add_custom_taxonomies() 'new_item_name' => __('Nom de la nouvelle Thématique'), 'menu_name' => __('Thématiques'), ), + 'public' => true, + // 'show_ui' => true, + 'show_admin_column' => true, 'hierarchical' => true, // This will allow URL's like "/locations/boston/cambridge/" 'rewrite' => array( 'slug' => 'thematiques', // This controls the base slug that will display before each term @@ -65,26 +68,26 @@ function add_custom_taxonomies() // ————— ————— - register_taxonomy('thematiques', ['fiche-questions', 'fiche-conseils'], array( + register_taxonomy('mots-cles', ['fiche-questions', 'fiche-conseils'], array( // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( - 'name' => _x('Thématiques', 'taxonomy general name'), - 'singular_name' => _x('Thématique', 'taxonomy singular name'), - 'search_items' => __('Chercher une Thématique'), - 'all_items' => __('Toutes les Thématiques'), - 'parent_item' => __('Thématique Parent'), - 'parent_item_colon' => __('Thématique Parent:'), - 'edit_item' => __('Editer la Thématique'), - 'update_item' => __('Mettre à jour la Thématique'), - 'add_new_item' => __('Ajouter une Thématique'), - 'new_item_name' => __('Nom de la nouvelle Thématique'), - 'menu_name' => __('Thématiques'), + 'name' => _x('Mots-Clés', 'taxonomy general name'), + 'singular_name' => _x('Mots-Clés', 'taxonomy singular name'), + 'search_items' => __('Chercher un Mots-Clé'), + 'all_items' => __('Tous les Mots-Clés'), + 'parent_item' => __('Mots-Clé Parent'), + 'parent_item_colon' => __('Mots-Clé Parent:'), + 'edit_item' => __('Editer le Mots-Clé'), + 'update_item' => __('Mettre à jour le Mots-Clé'), + 'add_new_item' => __('Ajouter un Mots-Clé'), + 'new_item_name' => __('Nom du nouveau Mots-Clés'), + 'menu_name' => __('Mots-Clés'), ), - 'hierarchical' => true, - 'public' => true, + 'hierarchical' => false, + 'public' => false, 'rewrite' => array( 'slug' => 'thematiques', // This controls the base slug that will display before each term // 'with_front' => false, // Don't display the category base before "/locations/" @@ -92,4 +95,4 @@ function add_custom_taxonomies() ), )); } -add_action('init', 'add_custom_taxonomies', 0); \ No newline at end of file +add_action('init', 'add_custom_taxonomies', 0); diff --git a/includes/utilities.php b/includes/utilities.php index ecd9ea5..9e706b6 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -27,3 +27,16 @@ function getThematiqueFamilySlug($thematique_slug) return "location"; } } + +// Get automatic post used in BLOCK QUESTIONS FREQUENTES +function get_automatic_post($post_type) +{ + $automatic_query_args = array( + 'numberposts' => 2, + 'post_per_page' => 1, + 'post_status' => 'publish', + 'post_type' => 'fiche-questions', + 'thematiques' => $post_type, + ); + return get_posts($automatic_query_args)[0]; +} diff --git a/resources/css/app.css b/resources/css/app.css index b056e43..3cb02be 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -14,6 +14,8 @@ @import './components/card-large-content.css'; @import './components/section-titling.css'; +@import '../../template-components/card-frequent_question.css'; + /* ########### LAYOUT ############ */ @import './layout/header.css'; @import './layout/footer.css'; @@ -27,6 +29,8 @@ @import '../../template-blocks/home/latest-news/latest-news.css'; @import '../../template-blocks/home/aides-financieres/aides-financieres.css'; @import '../../template-blocks/home/show-thematiques/show-thematiques.css'; +@import '../../template-blocks/home/demarches-administratives/demarches-administratives.css'; +@import '../../template-blocks/home/questions-frequentes/questions-frequentes.css'; /* ########### UTILITIES ############ */ @import './utilities/shadows.css'; diff --git a/resources/css/components/card-large-content.css b/resources/css/components/card-large-content.css index 4fb04cb..062cfd4 100644 --- a/resources/css/components/card-large-content.css +++ b/resources/css/components/card-large-content.css @@ -1,3 +1,36 @@ -.card-large-content { - @apply bg-white max-w-screen-xl w-full rounded-3xl p-16; +.card-large-content-container { + @apply bg-gray py-16 flex flex-col items-center; + &--has-illustration { + @apply pt-48; + } +} +.card-large-content { + @apply bg-white max-w-screen-2xl w-full rounded-3xl p-16 relative; + &--has-illustration { + @apply pt-40; + } + &__top-illustration { + @apply absolute top-0 left-1/2; + transform: translate(-50%, -50%); + } + &__links-container { + @apply grid grid-cols-3 gap-12; + } + &__link { + @apply text-2xl mt-8; + + &__page_icon { + max-width: 80px; + } + &__title { + @apply text-xl font-bold mt-3; + } + &__excerpt { + @apply text-lg pt-3; + } + + .cta { + @apply mt-8; + } + } } diff --git a/resources/css/components/cta.css b/resources/css/components/cta.css index a311ba8..2db72ee 100644 --- a/resources/css/components/cta.css +++ b/resources/css/components/cta.css @@ -1,5 +1,5 @@ .cta { - @apply rounded-full px-10 py-4 block w-fit my-2; + @apply rounded-full px-8 py-4 block w-fit my-2 text-base font-bold; &--primary { @apply bg-primary text-white font-bold; } diff --git a/resources/css/components/section-titling.css b/resources/css/components/section-titling.css index a673dab..30fc012 100644 --- a/resources/css/components/section-titling.css +++ b/resources/css/components/section-titling.css @@ -12,6 +12,11 @@ &__subtitle { @apply text-black font-bold + max-w-3xl mx-auto text-4xl; } + + &__description { + @apply text-lg pt-4 max-w-3xl mx-auto; + } } diff --git a/resources/img/illustrations/illustration-que-fait-homegrade-pour-vous.svg b/resources/img/illustrations/illustration-que-fait-homegrade-pour-vous.svg new file mode 100644 index 0000000..b5a8a98 --- /dev/null +++ b/resources/img/illustrations/illustration-que-fait-homegrade-pour-vous.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/pictogrammes/pictogramme-FAQ.svg b/resources/img/pictogrammes/pictogramme-FAQ.svg new file mode 100644 index 0000000..93b5418 --- /dev/null +++ b/resources/img/pictogrammes/pictogramme-FAQ.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/pictogrammes/pictogramme-contact.svg b/resources/img/pictogrammes/pictogramme-contact.svg new file mode 100644 index 0000000..adbc7bd --- /dev/null +++ b/resources/img/pictogrammes/pictogramme-contact.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/pictogrammes/pictogramme-outils.svg b/resources/img/pictogrammes/pictogramme-outils.svg new file mode 100644 index 0000000..72f3524 --- /dev/null +++ b/resources/img/pictogrammes/pictogramme-outils.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/pictogrammes/pictogramme-services.svg b/resources/img/pictogrammes/pictogramme-services.svg new file mode 100644 index 0000000..f405bd3 --- /dev/null +++ b/resources/img/pictogrammes/pictogramme-services.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/template-blocks/home/aides-financieres/aides-financieres.css b/template-blocks/home/aides-financieres/aides-financieres.css index 6f5e727..bff3564 100755 --- a/template-blocks/home/aides-financieres/aides-financieres.css +++ b/template-blocks/home/aides-financieres/aides-financieres.css @@ -1,5 +1,4 @@ #block-aides-financieres { - @apply bg-gray py-16 flex flex-col items-center; .section_titling { @apply max-w-screen-md; } diff --git a/template-blocks/home/aides-financieres/aides-financieres.php b/template-blocks/home/aides-financieres/aides-financieres.php index 8ef7d91..8e8ca69 100755 --- a/template-blocks/home/aides-financieres/aides-financieres.php +++ b/template-blocks/home/aides-financieres/aides-financieres.php @@ -4,7 +4,7 @@ $renolution_datas = get_field('renolution_datas'); ?> -
+

Aides financières

@@ -13,7 +13,7 @@ $renolution_datas = get_field('renolution_datas');

diff --git a/template-blocks/home/aides-financieres/block.json b/template-blocks/home/aides-financieres/block.json index e732dcd..a5f1ba7 100644 --- a/template-blocks/home/aides-financieres/block.json +++ b/template-blocks/home/aides-financieres/block.json @@ -1,6 +1,6 @@ { "name": "acf/aides-financieres", - "title": "Home | Aides Financières", + "title": "Aides Financières", "category": "homegrade-page-home", "multiple": false, "icon": { diff --git a/template-blocks/home/aides-financieres/coins.svg b/template-blocks/home/aides-financieres/coins.svg deleted file mode 100755 index c6bac11..0000000 --- a/template-blocks/home/aides-financieres/coins.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/template-blocks/home/aides-financieres/coins2.svg b/template-blocks/home/aides-financieres/coins2.svg deleted file mode 100644 index 8359cae..0000000 --- a/template-blocks/home/aides-financieres/coins2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/template-blocks/home/demarches-administratives/block.json b/template-blocks/home/demarches-administratives/block.json new file mode 100644 index 0000000..e00dab3 --- /dev/null +++ b/template-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/template-blocks/home/demarches-administratives/demarches-administratives.css b/template-blocks/home/demarches-administratives/demarches-administratives.css new file mode 100755 index 0000000..2a30bd7 --- /dev/null +++ b/template-blocks/home/demarches-administratives/demarches-administratives.css @@ -0,0 +1,15 @@ +#block-demarches-administratives { + &.card-large-content-container--has-illustration { + @apply pt-64; + } + + .card-large-content--has-illustration { + @apply pt-28; + } + .card-large-content__top-illustration { + transform: translate(-50%, -70%); + } + .card-large-content__links-container { + @apply grid-cols-4; + } +} diff --git a/template-blocks/home/demarches-administratives/demarches-administratives.php b/template-blocks/home/demarches-administratives/demarches-administratives.php new file mode 100755 index 0000000..3e0b2ce --- /dev/null +++ b/template-blocks/home/demarches-administratives/demarches-administratives.php @@ -0,0 +1,48 @@ +'; +// print_r($demarches_administratives_links); +echo ''; + +?> + + +
+ +
+ +
+

+

+

+
+ + +
+
\ No newline at end of file diff --git a/template-blocks/home/home-header/block.json b/template-blocks/home/home-header/block.json index f2abe07..f773d83 100644 --- a/template-blocks/home/home-header/block.json +++ b/template-blocks/home/home-header/block.json @@ -1,6 +1,6 @@ { "name": "acf/home-header", - "title": "Home | Section d'accueil", + "title": "Section d'accueil", "category": "homegrade-page-home", "multiple": false, "icon": { @@ -14,8 +14,14 @@ "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/template-blocks/home/latest-news/block.json b/template-blocks/home/latest-news/block.json index 43e60b3..74c91c8 100644 --- a/template-blocks/home/latest-news/block.json +++ b/template-blocks/home/latest-news/block.json @@ -1,6 +1,6 @@ { "name": "acf/latest-news", - "title": "Home | Dernières News", + "title": "Dernières News", "category": "homegrade-page-home", "multiple": false, "icon": { diff --git a/template-blocks/home/questions-frequentes/block.json b/template-blocks/home/questions-frequentes/block.json new file mode 100644 index 0000000..9af4ef7 --- /dev/null +++ b/template-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/template-blocks/home/questions-frequentes/questions-frequentes.css b/template-blocks/home/questions-frequentes/questions-frequentes.css new file mode 100644 index 0000000..d6c9cc3 --- /dev/null +++ b/template-blocks/home/questions-frequentes/questions-frequentes.css @@ -0,0 +1,7 @@ +#block-questions-frequentes { + @apply py-28; +} + +.questions-frequentes-grid { + @apply grid grid-cols-3 gap-8 gap-x-8 max-w-screen-xl mx-auto; +} diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.php b/template-blocks/home/questions-frequentes/questions-frequentes.php new file mode 100644 index 0000000..4bdf6b2 --- /dev/null +++ b/template-blocks/home/questions-frequentes/questions-frequentes.php @@ -0,0 +1,45 @@ + + +
+
+

Les questions les plus fréquentes

+

Simplifions votre recherche !

+
+
+ 'thematiques', + 'hide_empty' => false, + 'parent' => 0 + + )); + // echo '
';
+		// print_r($thematique_terms);
+		// echo '
'; + // $thematiques = ['location', 'acoustique']; + foreach ($thematique_terms as $key => $thematique) { + $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->slug); + + get_template_part( + 'template-components/card-frequent-question', + null, + array( + 'thematique' => $thematique_datas, + 'post_ID' => $post_datas->ID, + 'post_title' => $post_datas->post_title, + 'post_excerpt' => $post_datas->post_excerpt, + ) + ); + } + ?> +
+ +
\ No newline at end of file diff --git a/template-blocks/home/show-thematiques/block.json b/template-blocks/home/show-thematiques/block.json index d4f8234..08f9ef2 100644 --- a/template-blocks/home/show-thematiques/block.json +++ b/template-blocks/home/show-thematiques/block.json @@ -1,6 +1,6 @@ { "name": "acf/show-thematiques", - "title": "Home | Thématiques", + "title": "Thématiques", "category": "homegrade-page-home", "multiple": false, "icon": { diff --git a/template-components/card-frequent-question.php b/template-components/card-frequent-question.php new file mode 100644 index 0000000..bb74082 --- /dev/null +++ b/template-components/card-frequent-question.php @@ -0,0 +1,22 @@ +'; +// print_r($thematique_icon); +// // print_r($args); +// echo ''; + +?> + +
+ +

name ?>

+

+ +
+ +

name ?>

+ +
+ +
\ No newline at end of file diff --git a/template-components/card-frequent_question.css b/template-components/card-frequent_question.css new file mode 100644 index 0000000..2f2cc10 --- /dev/null +++ b/template-components/card-frequent_question.css @@ -0,0 +1,19 @@ +.card-frequent-question { + @apply shadowed p-8 rounded-3xl; + + &__icon { + max-width: 80px; + } + &__title { + @apply mt-4; + @apply text-xl pb-4 font-bold; + } + + &__tags_container { + @apply flex flex-wrap gap-x-3; + + .tag { + @apply py-1 px-4 rounded-lg; + } + } +}