From 19027d2d4b6a2b39aa91c1b589bd003dc5f8ce3a Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 9 Aug 2023 18:01:12 +0200 Subject: [PATCH] handling archives pages --- archive-brochures.php | 49 ++ css/admin-style.css | 96 ++++ css/app.css | 479 +++++++++++++++--- includes/admin.php | 31 +- includes/navwalker.php | 2 +- includes/post_types.php | 15 +- includes/rooting.php | 16 + includes/shortcuts/shortcuts.php | 4 +- includes/taxonomy.php | 29 +- includes/utilities.php | 11 +- resources/css/admin-style.css | 74 +++ resources/css/app.css | 9 + resources/css/blocks/highlight.css | 10 + .../css/components/archive-page-header.css | 32 ++ resources/css/components/breadcrumb.css | 20 + resources/css/components/brochures-grid.css | 26 + .../css/components/card-large-content.css | 2 +- resources/css/components/search-module.css | 1 + resources/css/components/section-titling.css | 9 +- .../components/thematiques-post-viewer.css | 19 + resources/css/layout/footer.css | 2 +- resources/css/layout/gutenberg.css | 125 +++-- .../css/pages/template-archive-brochures.css | 6 + .../css/pages/template-archive-conseils.css | 0 .../css/pages/template-archive-questions.css | 9 + resources/css/utilities/rounding-radius.css | 3 + .../illustration-homegrade-help.svg | 72 +++ .../img/pictogrammes/pictogramme-conseils.svg | 26 + searchform-custom-1.php | 14 + single.php | 12 +- .../demarches-administratives.php | 3 - .../questions-frequentes.php | 1 - .../show-thematiques/show-thematiques.php | 3 - .../card-frequent-question.php | 1 + template-components/card-news.php | 6 +- .../header/menu-renovateur.php | 11 +- template-components/header/search-module.php | 2 +- template-conseils.php | 110 ++++ template-publications.php | 86 ++++ template-questions.php | 95 ++++ 40 files changed, 1341 insertions(+), 180 deletions(-) create mode 100644 archive-brochures.php create mode 100644 resources/css/blocks/highlight.css create mode 100644 resources/css/components/archive-page-header.css create mode 100644 resources/css/components/breadcrumb.css create mode 100644 resources/css/components/brochures-grid.css create mode 100644 resources/css/components/thematiques-post-viewer.css create mode 100644 resources/css/pages/template-archive-brochures.css create mode 100644 resources/css/pages/template-archive-conseils.css create mode 100644 resources/css/pages/template-archive-questions.css create mode 100644 resources/css/utilities/rounding-radius.css create mode 100644 resources/img/illustrations/illustration-homegrade-help.svg create mode 100644 resources/img/pictogrammes/pictogramme-conseils.svg create mode 100644 searchform-custom-1.php create mode 100644 template-conseils.php create mode 100644 template-publications.php create mode 100644 template-questions.php diff --git a/archive-brochures.php b/archive-brochures.php new file mode 100644 index 0000000..0196519 --- /dev/null +++ b/archive-brochures.php @@ -0,0 +1,49 @@ + + + + +
+ +

+ +

+

+ +

+ +
+ +
+ + + '; + print_r($file); + echo ''; + + ?> + + +
+

+
+ + + + + +
+ + + *:not(.entry-content, .chapter-header-block), max-width: 960px; } -.entry-content h1, .block-editor-block-list__layout h1 { +.entry-content--acoustique-coproprietes h2, + .entry-content--acoustique-coproprietes h3 { + --tw-text-opacity: 1; + color: rgb(36 94 242 / var(--tw-text-opacity)); +} + +.entry-content--acoustique-coproprietes ul li::marker { + --tw-text-opacity: 1; + color: rgb(36 94 242 / var(--tw-text-opacity)); +} + +.entry-content--acoustique-coproprietes .homegrade-blocks-highlight { + --tw-bg-opacity: 1; + background-color: rgb(223 241 255 / var(--tw-bg-opacity)); +} + +.entry-content--energies-urbanisme h2, + .entry-content--energies-urbanisme h3 { + --tw-text-opacity: 1; + color: rgb(2 126 80 / var(--tw-text-opacity)); +} + +.entry-content--energies-urbanisme ul li::marker { + --tw-text-opacity: 1; + color: rgb(2 126 80 / var(--tw-text-opacity)); +} + +.entry-content--energies-urbanisme .homegrade-blocks-highlight { + --tw-bg-opacity: 1; + background-color: rgb(227 255 240 / var(--tw-bg-opacity)); +} + +.entry-content--isolation-quotidien h2, + .entry-content--isolation-quotidien h3 { + --tw-text-opacity: 1; + color: rgb(194 69 3 / var(--tw-text-opacity)); +} + +.entry-content--isolation-quotidien ul li::marker { + --tw-text-opacity: 1; + color: rgb(194 69 3 / var(--tw-text-opacity)); +} + +.entry-content--isolation-quotidien .homegrade-blocks-highlight { + --tw-bg-opacity: 1; + background-color: rgb(255 251 236 / var(--tw-bg-opacity)); +} + +.entry-content--patrimoine-renovation h1, + .entry-content--patrimoine-renovation h2, + .entry-content--patrimoine-renovation h3 { + --tw-text-opacity: 1; + color: rgb(139 47 247 / var(--tw-text-opacity)); +} + +.entry-content--patrimoine-renovation ul li::marker { + --tw-text-opacity: 1; + color: rgb(139 47 247 / var(--tw-text-opacity)); +} + +.entry-content--patrimoine-renovation .homegrade-blocks-highlight { + --tw-bg-opacity: 1; + background-color: rgb(255 229 253 / var(--tw-bg-opacity)); +} + +.entry-content--location h2, + .entry-content--location h3 { + --tw-text-opacity: 1; + color: rgb(223 0 43 / var(--tw-text-opacity)); +} + +.entry-content--location ul li::marker { + --tw-text-opacity: 1; + color: rgb(223 0 43 / var(--tw-text-opacity)); +} + +.entry-content--location .homegrade-blocks-highlight { + --tw-bg-opacity: 1; + background-color: rgb(254 226 231 / var(--tw-bg-opacity)); +} + +.entry-content h1 { font-size: 1.5rem; line-height: 2rem; } -.entry-content h2, .block-editor-block-list__layout h2 { +.entry-content h2 { font-size: 1.25rem; } -.entry-content h3, .block-editor-block-list__layout h3 { - font-size: 1.125rem; - line-height: 1.75rem; +.entry-content h3 { + font-size: 1.5rem; + line-height: 2rem; + font-weight: 700; } -.entry-content p a, .entry-content ul a, .entry-content ol a, .block-editor-block-list__layout p a, .block-editor-block-list__layout ul a, .block-editor-block-list__layout ol a { +.entry-content p a, .entry-content ul a, .entry-content ol a { + font-weight: 700; --tw-text-opacity: 1; - color: rgb(59 130 246 / var(--tw-text-opacity)); + color: rgb(47 1 84 / var(--tw-text-opacity)); -webkit-text-decoration-line: underline; text-decoration-line: underline; + text-underline-offset: 4px; } -.entry-content p a:hover, .entry-content ul a:hover, .entry-content ol a:hover, .block-editor-block-list__layout p a:hover, .block-editor-block-list__layout ul a:hover, .block-editor-block-list__layout ol a:hover { +/* &:after { + @apply inline-block bg-red-500 h-3 w-3 ml-2; + content: ''; + background-image: url('/wp-content/themes/homegrade/dist/images/arrow.svg'); + } */ + +.entry-content p a:hover, .entry-content ul a:hover, .entry-content ol a:hover { -webkit-text-decoration-line: none; text-decoration-line: none; } .entry-content p, .entry-content ul, - .entry-content ol, - .block-editor-block-list__layout p, - .block-editor-block-list__layout ul, - .block-editor-block-list__layout ol { + .entry-content ol { margin-bottom: 2rem; } -.entry-content ul:not(.block-editor-block-variation-picker__variations) li, .block-editor-block-list__layout ul:not(.block-editor-block-variation-picker__variations) li { +.entry-content ul:not(.block-editor-block-variation-picker__variations) li { list-style-position: inside; list-style-type: disc; } -.entry-content ol li, .block-editor-block-list__layout ol li { +.entry-content ol li { list-style-position: inside; list-style-type: decimal; } -.single-editor-content h3 { - font-size: 1.5rem; - line-height: 2rem; - font-weight: 700; -} - -.single-editor-content--acoustique-coproprietes h2, - .single-editor-content--acoustique-coproprietes h3 { - --tw-text-opacity: 1; - color: rgb(36 94 242 / var(--tw-text-opacity)); -} - -.single-editor-content--acoustique-coproprietes ul li::marker { - --tw-text-opacity: 1; - color: rgb(36 94 242 / var(--tw-text-opacity)); -} - -.single-editor-content--energies-urbanisme h2, - .single-editor-content--energies-urbanisme h3 { - --tw-text-opacity: 1; - color: rgb(2 126 80 / var(--tw-text-opacity)); -} - -.single-editor-content--energies-urbanisme ul li::marker { - --tw-text-opacity: 1; - color: rgb(2 126 80 / var(--tw-text-opacity)); -} - -.single-editor-content--isolation-quotidien h2, - .single-editor-content--isolation-quotidien h3 { - --tw-text-opacity: 1; - color: rgb(194 69 3 / var(--tw-text-opacity)); -} - -.single-editor-content--isolation-quotidien ul li::marker { - --tw-text-opacity: 1; - color: rgb(194 69 3 / var(--tw-text-opacity)); -} - -.single-editor-content--patrimoine-renovation h1, - .single-editor-content--patrimoine-renovation h2, - .single-editor-content--patrimoine-renovation h3 { - --tw-text-opacity: 1; - color: rgb(139 47 247 / var(--tw-text-opacity)); -} - -.single-editor-content--patrimoine-renovation ul li::marker { - --tw-text-opacity: 1; - color: rgb(139 47 247 / var(--tw-text-opacity)); -} - -.single-editor-content--location h2, - .single-editor-content--location h3 { - --tw-text-opacity: 1; - color: rgb(223 0 43 / var(--tw-text-opacity)); -} - -.single-editor-content--location ul li::marker { - --tw-text-opacity: 1; - color: rgb(223 0 43 / var(--tw-text-opacity)); -} - .menu-renovateur { position: relative; display: flex; @@ -3379,6 +3657,20 @@ article > *:not(.entry-content, .chapter-header-block), font-weight: 700; } +.homegrade-blocks-highlight { + padding: 3rem; + border-radius: 22px; +} + +.homegrade-blocks-highlight h3 { + padding-bottom: 1rem; +} + +.homegrade-blocks-highlight .icon { + --tw-bg-opacity: 1; + background-color: rgb(47 1 84 / var(--tw-bg-opacity)); +} + /* ########### PAGE ############ */ .demo-components .title { @@ -3400,6 +3692,37 @@ article > *:not(.entry-content, .chapter-header-block), gap: 2rem; } +.archives-publications-header { + margin-left: auto; + margin-right: auto; + max-width: 1280px; + --tw-bg-opacity: 1; + background-color: rgb(47 1 84 / var(--tw-bg-opacity)); + text-align: center; + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.brochures-archives { + margin-left: auto; + margin-right: auto; + max-width: 1280px; + padding-top: 1rem; + padding-bottom: 1rem; +} + +.card-large-content-container { + margin-top: 3rem; + margin-bottom: 0px; + padding-top: 10rem; +} + +@media (min-width: 960px) { + .card-large-content-container .card-large-content__links-container { + gap: 8rem; + } +} + .hover\:bg-primary:hover { --tw-bg-opacity: 1; background-color: rgb(47 1 84 / var(--tw-bg-opacity)); diff --git a/includes/admin.php b/includes/admin.php index e2de08b..b0e4a6b 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -119,12 +119,15 @@ function add_acf_posts_columns($columns) return array_merge($new_admin_col_arrays); } add_filter('manage_conseils_posts_columns', 'add_acf_posts_columns'); -add_filter('manage_fiche-questions_posts_columns', 'add_acf_posts_columns'); +add_filter('manage_questions_posts_columns', 'add_acf_posts_columns'); add_filter('manage_brochures_posts_columns', 'add_acf_posts_columns'); // CUSTOMISATION DE LA COLONNE POUR AFFICHER : THEMATIQUE PARENT > THEMATIQUE function handle_posts_custom_columns($column, $post_id) { + if ($column != 'thematiques_taxo') { + return; + } $tax = get_the_terms($post_id, ('thematiques')); $edit_link = esc_url(get_edit_term_link($tax[0]->term_id, 'thematiques', 'conseils')); @@ -137,5 +140,29 @@ function handle_posts_custom_columns($column, $post_id) echo ''; } add_action('manage_conseils_posts_custom_column', 'handle_posts_custom_columns', 10, 2); -add_action('manage_fiche-questions_posts_custom_column', 'handle_posts_custom_columns', 10, 2); +add_action('manage_questions_posts_custom_column', 'handle_posts_custom_columns', 10, 2); add_action('manage_brochures_posts_custom_column', 'handle_posts_custom_columns', 10, 2); + + + + +/* ---------------------------------------------------------------------- + ADDING CLASS TO ADMIN BODY + ------------------------------------------------------------------------*/ +function wpdocs_admin_classes($classes) +{ + global $pagenow; + global $post; + $thematique = get_the_terms(get_the_ID(), 'thematiques')[0]; + $thematiqueParent = getParentThematique($thematique); + $thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug); + + + if (in_array($pagenow, array('post.php', 'post-new.php'), true) && $thematiqueColorSlug) { + $classes .= ' salut ' . $thematiqueColorSlug; + } + + return $classes; +} + +add_filter('admin_body_class', 'wpdocs_admin_classes'); diff --git a/includes/navwalker.php b/includes/navwalker.php index a238e1b..5b7036d 100644 --- a/includes/navwalker.php +++ b/includes/navwalker.php @@ -27,7 +27,7 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args) } // #### ICONE DE PAGE FOR TOP LEVEL MENU ITEMS - if (isset($page_icon)) { + if (isset($page_icon['url'])) { $icon = ''; $link = $output; $output = $icon . $link; diff --git a/includes/post_types.php b/includes/post_types.php index 21b14a0..7596846 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -57,7 +57,7 @@ function create_posttype() ], 'hierarchical' => true, 'public' => true, - 'has_archive' => true, + 'has_archive' => false, 'show_in_rest' => true, 'menu_icon' => 'dashicons-pressthis', 'menu_position' => 2, @@ -75,7 +75,7 @@ function create_posttype() ), 'hierarchical' => true, 'public' => true, - 'has_archive' => true, + 'has_archive' => false, 'show_in_rest' => true, 'menu_icon' => 'dashicons-book', 'menu_position' => 2, @@ -84,18 +84,19 @@ function create_posttype() ) ); register_post_type( - 'fiche-questions', + 'questions', array( 'labels' => array( 'name' => __('Questions', 'homegrade-theme__texte-backoffice'), 'singular_name' => __('Question', 'homegrade-theme__texte-backoffice') ), 'public' => true, - 'has_archive' => true, - 'rewrite' => array('slug' => 'fiche-question'), + 'has_archive' => false, + // 'rewrite' => array('slug' => 'questions'), + // 'rewrite' => array('slug' => 'questions/%thematiques%'), 'show_in_rest' => true, 'menu_icon' => 'dashicons-editor-help', - 'menu_position' => 4, + 'menu_position' => 2.1, 'supports' => array('title', 'custom-fields', 'editor', 'excerpt'), ) ); @@ -142,7 +143,7 @@ function my_new_admin_menu_order($menu_order) 'upload.php' => 9, // 'edit.php?post_type=page' => 1, 'edit.php?post_type=conseils' => 1, - 'edit.php?post_type=fiche-questions' => 2, + 'edit.php?post_type=questions' => 2, 'edit.php?post_type=brochures' => 3, 'edit.php?post_type=vocabulaire' => 4, ); diff --git a/includes/rooting.php b/includes/rooting.php index a82b23b..fdeeb1c 100644 --- a/includes/rooting.php +++ b/includes/rooting.php @@ -11,3 +11,19 @@ function redirect_to_demo_components_page() exit(); } } + + +// function wpa_course_post_link($post_link, $id = 0) +// { +// $post = get_post($id); +// if (is_object($post) && ICL_LANGUAGE_CODE == 'fr') { +// $terms = wp_get_object_terms($post->ID, 'thematiques'); +// if ($terms) { +// return str_replace('%thematiques%', $terms[0]->slug, $post_link); +// } +// } + + +// return $post_link; +// } +// add_filter('post_type_link', 'wpa_course_post_link', 1, 3); diff --git a/includes/shortcuts/shortcuts.php b/includes/shortcuts/shortcuts.php index cf65538..d0221d3 100644 --- a/includes/shortcuts/shortcuts.php +++ b/includes/shortcuts/shortcuts.php @@ -35,8 +35,8 @@ get_template_part( ) ); -/** ------------------------------ - QUERIES +/* ------------------------------ + QUERIES ------------------------------*/ diff --git a/includes/taxonomy.php b/includes/taxonomy.php index cc0ee22..71ab6fd 100644 --- a/includes/taxonomy.php +++ b/includes/taxonomy.php @@ -44,7 +44,7 @@ function undo_create_term($term_id, $tt_id, $taxonomy) function add_custom_taxonomies() { // ————— Thématiques ————— - register_taxonomy('thematiques', ['fiche-questions', 'conseils', 'brochures'], array( + register_taxonomy('thematiques', ['questions', 'conseils', 'brochures'], array( // 'hierarchical' => true, 'labels' => array( 'name' => __('Thématiques', 'homegrade-theme__texte-backoffice'), @@ -67,7 +67,7 @@ function add_custom_taxonomies() 'show_in_quick_edit' => false, 'meta_box_cb' => false, 'rewrite' => array( - 'slug' => 'nos-conseils-thematiques', + 'slug' => 'questions-thematiques', // 'with_front' => false, 'hierarchical' => true, 'has_archive' => true @@ -77,7 +77,7 @@ function add_custom_taxonomies() // ————— mots-clés ————— - register_taxonomy('mots-cles', ['fiche-questions', 'conseils'], array( + register_taxonomy('mots-cles', ['questions', 'conseils'], array( // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( @@ -103,6 +103,27 @@ function add_custom_taxonomies() add_action('init', 'add_custom_taxonomies', 0); /* ---------------------------------------------------------------------- - Add custom taxonomy terms to body class + HIDE THEMATIQUE METABOX ------------------------------------------------------------------------*/ +// on passe le metabox_cb à false pour ne pas afficher la metabox +function tna_edit_taxonomy_args($args, $tax_slug, $cptui_tax_args) +{ + // Alternatively, you can check for specific taxonomies. + if ('thematiques' === $tax_slug) { + $args['meta_box_cb'] = false; + } + return $args; +} +add_filter('cptui_pre_register_taxonomy', 'tna_edit_taxonomy_args', 10, 3); +// on récupère les élément avec un metabox_cb false et on les masque dans la sidebar +add_filter('rest_prepare_taxonomy', function ($response, $taxonomy, $request) { + $context = !empty($request['context']) ? $request['context'] : 'view'; + // Context is edit in the editor + if ($context === 'edit' && $taxonomy->meta_box_cb === false) { + $data_response = $response->get_data(); + $data_response['visibility']['show_ui'] = false; + $response->set_data($data_response); + } + return $response; +}, 10, 3); diff --git a/includes/utilities.php b/includes/utilities.php index 847b117..b5132a1 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -8,29 +8,35 @@ function getThematiqueFamilySlug($thematique_slug) return "energies-urbanisme"; case "acoustique": + case "akoestiek": case "petites-coproprietes": + case "kleine-mede-eigendommen": return "acoustique-coproprietes"; case "isolation": + case "isolatie": case "au-quotidien": return "isolation-quotidien"; case "energies": case "urbanisme": + case "stedenbouw": return "energies-urbanisme"; case "patrimoine": + case "erfgoed": case "renovation": return "patrimoine-renovation"; case "location": + case "verhuur": return "location"; } } function getParentThematique($thematique) { - if($thematique->parent == 0) { + if ($thematique->parent == 0) { return $thematique; } else { return get_term($thematique->parent, 'thematiques'); @@ -42,10 +48,9 @@ function getParentThematique($thematique) function get_automatic_post($post_type) { $automatic_query_args = array( - 'numberposts' => 2, 'post_per_page' => 1, 'post_status' => 'publish', - 'post_type' => 'fiche-questions', + 'post_type' => 'questions', 'thematiques' => $post_type, ); return get_posts($automatic_query_args)[0]; diff --git a/resources/css/admin-style.css b/resources/css/admin-style.css index e18e9f1..7069bf5 100644 --- a/resources/css/admin-style.css +++ b/resources/css/admin-style.css @@ -10,3 +10,77 @@ #toplevel_page_theme-general-settings { border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important; } + +/* .wp-block-post-content, +.is-root-container { + background-color: red !imporatant; +} + +.block-editor-block-list__block { + background-color: yellow !imporatant; */ +/* } */ + +body.acoustique-coproprietes { + h2, + h3 { + @apply text-acoustique-coproprietes; + } + ul li::marker { + @apply text-acoustique-coproprietes; + } + .homegrade-blocks-highlight { + @apply bg-acoustique-coproprietes-light; + } +} +body.energies-urbanisme { + h2, + h3 { + @apply text-energies-urbanisme; + } + ul li::marker { + @apply text-energies-urbanisme; + } + .homegrade-blocks-highlight { + @apply bg-energies-urbanisme-light; + } +} +body.isolation-quotidien { + h2, + h3 { + @apply text-isolation-quotidien; + } + ul li::before { + @apply bg-isolation-quotidien; + } + ul li::marker { + @apply text-isolation-quotidien; + } + .homegrade-blocks-highlight { + @apply bg-isolation-quotidien-light; + } +} +body.patrimoine-renovation { + h1, + h2, + h3 { + @apply text-patrimoine-renovation; + } + ul li::marker { + @apply text-patrimoine-renovation; + } + .homegrade-blocks-highlight { + @apply bg-patrimoine-renovation-light; + } +} +body.location { + h2, + h3 { + @apply text-location; + } + ul li::marker { + @apply text-location; + } + .homegrade-blocks-highlight { + @apply bg-location-light; + } +} diff --git a/resources/css/app.css b/resources/css/app.css index dd76041..5147f49 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -5,6 +5,7 @@ /* ########### UTILITIES ############ */ @import './utilities/shadows.css'; @import './utilities/animation.css'; +@import './utilities/rounding-radius.css'; /* ########### BASE ############ */ @import './base/typography.css'; @@ -17,6 +18,10 @@ @import './components/card-large-content.css'; @import './components/section-titling.css'; @import './components/search-module.css'; +@import './components/thematiques-post-viewer.css'; +@import './components/breadcrumb.css'; +@import './components/archive-page-header.css'; +@import './components/brochures-grid.css'; @import '../../template-components/card-news.css'; @import '../../template-components/card-frequent_question.css'; @@ -44,6 +49,10 @@ @import './blocks/chapter-header-block.css'; @import './blocks/questions-container-block.css'; @import './blocks/points-cles.css'; +@import './blocks/highlight.css'; /* ########### PAGE ############ */ @import './pages/demo-components.css'; +@import './pages/template-archive-brochures.css'; +@import './pages/template-archive-conseils.css'; +@import './pages/template-archive-questions.css'; diff --git a/resources/css/blocks/highlight.css b/resources/css/blocks/highlight.css new file mode 100644 index 0000000..b3439c6 --- /dev/null +++ b/resources/css/blocks/highlight.css @@ -0,0 +1,10 @@ +.homegrade-blocks-highlight { + @apply p-12 rounding-radius; + + h3 { + @apply pb-4; + } + .icon { + @apply bg-primary; + } +} diff --git a/resources/css/components/archive-page-header.css b/resources/css/components/archive-page-header.css new file mode 100644 index 0000000..01b65fd --- /dev/null +++ b/resources/css/components/archive-page-header.css @@ -0,0 +1,32 @@ +.archive-page-header { + @apply bg-primary text-white text-center py-12 max-w-screen-xl mx-auto + mt-0 rounded-2xl; + &__title { + @apply uppercase font-medium text-xl tracking-widest; + } + &__description { + @apply font-bold text-4xl max-w-screen-md mx-auto pt-4; + } + /* POUR TEMPLATE ARCHIVE CONSEILS ET ARCHIVE QUESTIONS */ + &__terms-grid { + @apply grid grid-cols-4 max-w-screen-md mx-auto gap-4 p-4 pt-8; + + .term { + @apply bg-white rounded-3xl px-4 py-6 font-bold leading-4; + } + .term img { + @apply rounded-lg pb-4 max-w-[80px] mx-auto; + } + } + /* POUR PUBLICATIONS */ + &__search-grid { + @apply grid grid-cols-4 max-w-screen-md mx-auto gap-4 p-4 pt-8; + + .term { + @apply bg-white rounded-3xl px-4 py-6 font-bold leading-4; + } + .term img { + @apply rounded-lg pb-4 max-w-[80px] mx-auto; + } + } +} diff --git a/resources/css/components/breadcrumb.css b/resources/css/components/breadcrumb.css new file mode 100644 index 0000000..474fc03 --- /dev/null +++ b/resources/css/components/breadcrumb.css @@ -0,0 +1,20 @@ +.breadcrumbs_navigation { + @apply py-6 max-w-screen-xl mx-auto; + ol { + @apply list-none flex items-center text-sm font-bold; + + li + li { + &:before { + @apply ml-1 mr-2; + @apply inline-block; + content: ''; + border-right: 2.5px solid #000; + border-bottom: 2.5px solid #000; + border-radius: 2px; + height: 8px; + width: 8px; + transform: rotate(-45deg); + } + } + } +} diff --git a/resources/css/components/brochures-grid.css b/resources/css/components/brochures-grid.css new file mode 100644 index 0000000..68b6c41 --- /dev/null +++ b/resources/css/components/brochures-grid.css @@ -0,0 +1,26 @@ +.brochures-grid { + @apply max-w-screen-xl mx-auto py-12 mb-12; + + &__row { + @apply grid grid-cols-11 gap-8; + align-items: center; + } + &__row + &__row { + @apply mt-8 border-t border-gray pt-8; + } + &__cover { + @apply w-20 rounded-lg col-span-1; + } + &__title { + @apply col-span-4 font-bold; + } + &__thematique { + @apply col-span-2 text-center; + } + &__edition { + @apply col-span-2 text-center; + } + &__button { + @apply col-span-2 flex justify-end; + } +} diff --git a/resources/css/components/card-large-content.css b/resources/css/components/card-large-content.css index 018adcf..82d068f 100644 --- a/resources/css/components/card-large-content.css +++ b/resources/css/components/card-large-content.css @@ -5,7 +5,7 @@ } } .card-large-content { - @apply bg-white max-w-screen-2xl w-full rounded-3xl p-16 relative; + @apply bg-white max-w-screen-xl w-full rounded-3xl p-16 relative; &--has-illustration { @apply pt-40; } diff --git a/resources/css/components/search-module.css b/resources/css/components/search-module.css index 4614365..dbd2a6c 100644 --- a/resources/css/components/search-module.css +++ b/resources/css/components/search-module.css @@ -40,6 +40,7 @@ height: 1px; } &__input { + box-sizing: border-box; @apply block max-w-full flex-grow py-3 border border-black rounded-tl-3xl rounded-bl-3xl px-4; } button[type='submit'] { diff --git a/resources/css/components/section-titling.css b/resources/css/components/section-titling.css index f3cad24..37adcb7 100644 --- a/resources/css/components/section-titling.css +++ b/resources/css/components/section-titling.css @@ -1,5 +1,8 @@ .section_titling { @apply text-center pb-8; + &--left { + @apply text-left; + } &__title { @apply text-secondary @@ -9,10 +12,14 @@ pb-2 tracking-widest; } + &.section_titling--left { + @apply bg-yellow-400; + } &__subtitle { @apply text-black font-bold - max-w-3xl mx-auto + max-w-3xl + mx-auto text-4xl; } diff --git a/resources/css/components/thematiques-post-viewer.css b/resources/css/components/thematiques-post-viewer.css new file mode 100644 index 0000000..11002b1 --- /dev/null +++ b/resources/css/components/thematiques-post-viewer.css @@ -0,0 +1,19 @@ +.thematiques-post-viewer { + @apply bg-primary text-white text-center py-12 max-w-screen-xl mx-auto mt-0; + &__title { + @apply uppercase font-medium text-xl tracking-widest; + } + &__description { + @apply font-bold text-4xl max-w-screen-md mx-auto pt-4; + } + &__terms-grid { + @apply grid grid-cols-4 max-w-screen-md mx-auto gap-4 p-4 pt-8; + + .term { + @apply bg-white rounded-3xl px-4 py-6 font-bold leading-4; + } + .term img { + @apply rounded-lg pb-4 max-w-[80px] mx-auto; + } + } +} diff --git a/resources/css/layout/footer.css b/resources/css/layout/footer.css index 36c90d2..6f7dc2e 100644 --- a/resources/css/layout/footer.css +++ b/resources/css/layout/footer.css @@ -1,5 +1,5 @@ .site-footer { - @apply bg-gray grid grid-cols-4 px-8 gap-8 mt-12; + @apply bg-gray grid grid-cols-4 px-8 gap-8; &__informative-message { @apply bg-primary text-white p-8 col-span-4 rounded-3xl flex justify-center; diff --git a/resources/css/layout/gutenberg.css b/resources/css/layout/gutenberg.css index 1a86f3a..f4cc902 100644 --- a/resources/css/layout/gutenberg.css +++ b/resources/css/layout/gutenberg.css @@ -3,8 +3,68 @@ article > *:not(.entry-content, .chapter-header-block), @apply mx-auto max-w-content; } -.entry-content, -.block-editor-block-list__layout { +.entry-content { + &--acoustique-coproprietes { + h2, + h3 { + @apply text-acoustique-coproprietes; + } + ul li::marker { + @apply text-acoustique-coproprietes; + } + .homegrade-blocks-highlight { + @apply bg-acoustique-coproprietes-light; + } + } + &--energies-urbanisme { + h2, + h3 { + @apply text-energies-urbanisme; + } + ul li::marker { + @apply text-energies-urbanisme; + } + .homegrade-blocks-highlight { + @apply bg-energies-urbanisme-light; + } + } + &--isolation-quotidien { + h2, + h3 { + @apply text-isolation-quotidien; + } + ul li::marker { + @apply text-isolation-quotidien; + } + .homegrade-blocks-highlight { + @apply bg-isolation-quotidien-light; + } + } + &--patrimoine-renovation { + h1, + h2, + h3 { + @apply text-patrimoine-renovation; + } + ul li::marker { + @apply text-patrimoine-renovation; + } + .homegrade-blocks-highlight { + @apply bg-patrimoine-renovation-light; + } + } + &--location { + h2, + h3 { + @apply text-location; + } + ul li::marker { + @apply text-location; + } + .homegrade-blocks-highlight { + @apply bg-location-light; + } + } h1 { @apply text-2xl; } @@ -14,14 +74,19 @@ article > *:not(.entry-content, .chapter-header-block), } h3 { - @apply text-lg; + @apply font-bold text-2xl; } p, ul, ol { a { - @apply text-blue-500 underline; + @apply text-primary font-bold underline underline-offset-4; + /* &:after { + @apply inline-block bg-red-500 h-3 w-3 ml-2; + content: ''; + background-image: url('/wp-content/themes/homegrade/dist/images/arrow.svg'); + } */ &:hover { @apply no-underline; @@ -43,55 +108,3 @@ article > *:not(.entry-content, .chapter-header-block), } } } - -.single-editor-content { - h3 { - @apply font-bold text-2xl; - } - &--acoustique-coproprietes { - h2, - h3 { - @apply text-acoustique-coproprietes; - } - ul li::marker { - @apply text-acoustique-coproprietes; - } - } - &--energies-urbanisme { - h2, - h3 { - @apply text-energies-urbanisme; - } - ul li::marker { - @apply text-energies-urbanisme; - } - } - &--isolation-quotidien { - h2, - h3 { - @apply text-isolation-quotidien; - } - ul li::marker { - @apply text-isolation-quotidien; - } - } - &--patrimoine-renovation { - h1, - h2, - h3 { - @apply text-patrimoine-renovation; - } - ul li::marker { - @apply text-patrimoine-renovation; - } - } - &--location { - h2, - h3 { - @apply text-location; - } - ul li::marker { - @apply text-location; - } - } -} diff --git a/resources/css/pages/template-archive-brochures.css b/resources/css/pages/template-archive-brochures.css new file mode 100644 index 0000000..7966846 --- /dev/null +++ b/resources/css/pages/template-archive-brochures.css @@ -0,0 +1,6 @@ +.archives-publications-header { + @apply bg-primary max-w-screen-xl text-white text-center mx-auto; +} +.brochures-archives { + @apply max-w-screen-xl mx-auto py-4; +} diff --git a/resources/css/pages/template-archive-conseils.css b/resources/css/pages/template-archive-conseils.css new file mode 100644 index 0000000..e69de29 diff --git a/resources/css/pages/template-archive-questions.css b/resources/css/pages/template-archive-questions.css new file mode 100644 index 0000000..b57e2b2 --- /dev/null +++ b/resources/css/pages/template-archive-questions.css @@ -0,0 +1,9 @@ +.card-large-content-container { + @apply pt-40 mt-12 mb-0; + + .card-large-content { + &__links-container { + @apply lg:gap-32; + } + } +} diff --git a/resources/css/utilities/rounding-radius.css b/resources/css/utilities/rounding-radius.css new file mode 100644 index 0000000..08aa7ae --- /dev/null +++ b/resources/css/utilities/rounding-radius.css @@ -0,0 +1,3 @@ +.rounding-radius { + border-radius: 22px; +} diff --git a/resources/img/illustrations/illustration-homegrade-help.svg b/resources/img/illustrations/illustration-homegrade-help.svg new file mode 100644 index 0000000..a22300a --- /dev/null +++ b/resources/img/illustrations/illustration-homegrade-help.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/pictogrammes/pictogramme-conseils.svg b/resources/img/pictogrammes/pictogramme-conseils.svg new file mode 100644 index 0000000..db073c1 --- /dev/null +++ b/resources/img/pictogrammes/pictogramme-conseils.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searchform-custom-1.php b/searchform-custom-1.php new file mode 100644 index 0000000..0a62915 --- /dev/null +++ b/searchform-custom-1.php @@ -0,0 +1,14 @@ +
+ +
+ + + + + + + +
\ No newline at end of file diff --git a/single.php b/single.php index b41217a..4f243fa 100644 --- a/single.php +++ b/single.php @@ -11,12 +11,12 @@ get_header(); $thematiqueParent = getParentThematique($thematique); $thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug); ?> -
"> +
"> - - -
+ + -

- - diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.php b/template-blocks/home/questions-frequentes/questions-frequentes.php index 589a054..f4b37f4 100644 --- a/template-blocks/home/questions-frequentes/questions-frequentes.php +++ b/template-blocks/home/questions-frequentes/questions-frequentes.php @@ -27,7 +27,6 @@ $block_titling = get_field('block_titling_description_datas'); $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, diff --git a/template-blocks/home/show-thematiques/show-thematiques.php b/template-blocks/home/show-thematiques/show-thematiques.php index a140167..05b9f79 100755 --- a/template-blocks/home/show-thematiques/show-thematiques.php +++ b/template-blocks/home/show-thematiques/show-thematiques.php @@ -43,9 +43,6 @@ $terms = get_terms(array( null, array( 'thematique' => $term, - 'post_ID' => $post_datas->ID, - 'post_title' => $post_datas->post_title, - 'post_excerpt' => $post_datas->post_excerpt, ) ); ?> diff --git a/template-components/card-frequent-question.php b/template-components/card-frequent-question.php index 4323867..0015208 100644 --- a/template-components/card-frequent-question.php +++ b/template-components/card-frequent-question.php @@ -1,4 +1,5 @@ '; diff --git a/template-components/card-news.php b/template-components/card-news.php index 093d5e5..ff1e063 100644 --- a/template-components/card-news.php +++ b/template-components/card-news.php @@ -3,7 +3,7 @@ $post_ID = $args['post_ID']; $card_variant = $args['card_variant']; $post_thumbnail = $args['post_thumbnail']; $post_title = $args['post_title']; -$post_tags = $args['post_tags']; +$post_tags = $args['post_tags'] ?? null; ?> @@ -14,7 +14,9 @@ $post_tags = $args['post_tags'];

-

name ?>

+ +

name ?>

+
diff --git a/template-components/header/menu-renovateur.php b/template-components/header/menu-renovateur.php index 802a32d..6c8487e 100644 --- a/template-components/header/menu-renovateur.php +++ b/template-components/header/menu-renovateur.php @@ -59,7 +59,7 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full'); ID; ?> - menu_item_parent == $item->ID) : ?> + menu_item_parent) && $menuitems[$key + 1]->menu_item_parent == $item->ID) : ?> diff --git a/template-components/header/search-module.php b/template-components/header/search-module.php index 4721034..a9cc3ed 100644 --- a/template-components/header/search-module.php +++ b/template-components/header/search-module.php @@ -5,7 +5,7 @@
-

Suggestions :

+ <>Suggestions : 'conseils', diff --git a/template-conseils.php b/template-conseils.php new file mode 100644 index 0000000..36caff1 --- /dev/null +++ b/template-conseils.php @@ -0,0 +1,110 @@ + 'thematiques', + 'hide_empty' => false, + 'parent' => 0 +)); + +?> +
+ +
+

+

+
    + + term_id)['icon']; + // $translated_term_id = icl_object_id($thematique->term_id, $thematique->taxonomy, true, ICL_LANGUAGE_CODE); + + // $thematique_icon = get_field('taxonomy_pictures', $thematique->taxonomy . '_' . $translated_term_id)['icon']; + + $original_term_ID = apply_filters('wpml_object_id', $thematique->term_id, 'thematiques', FALSE, 'fr'); + $thematique_icon = get_field('taxonomy_pictures', $thematique->taxonomy . '_' . $original_term_ID)['icon']; + $termSlug = getThematiqueFamilySlug($thematique->slug); + + $args = array( + 'posts_per_page' => 1, + 'post_type' => 'conseils', + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'term_id', + 'terms' => $thematique->term_id, + ) + ) + ); + $relatedPostConseil = get_posts($args); + + ?> + +
  • + + +

    Question name ?>

    +
    +
  • + + + +
+ +
+ + +
+ +
+ + +
+

+

+
+ + + + +
+ + + +
+ + + + +
+ + + +
+

+

+

+ + +
+ + +
+
+

+

Curabitur eleifend neque eu erat lacinia tincidunt

+
+ + + 'brochures', + 'posts_per_page' => -1, + 'post_status' => 'publish', + 'orderby' => 'date', + 'order' => 'DESC', + ); + $brochures = new WP_Query($args); + + + ?> +
    + have_posts()) : ?> + have_posts()) : $brochures->the_post(); ?> + + +
  • + + + +

    +

    name ?>

    + +

    + +
    + +
    +
  • + + + + + +
+ + +
+ + + +
+ + + + + + + 'thematiques', + 'hide_empty' => false, + 'parent' => 0 +)); + +?> + + +
+

+

+
    + + term_id, 'thematiques', TRUE, 'fr'); + $thematique_icon = get_field('taxonomy_pictures', $thematique->taxonomy . '_' . $original_term_ID)['icon']; + $termSlug = getThematiqueFamilySlug($thematique->slug); + + + ?> + +
  • + + +

    Question name ?>

    +
    +
  • + +
+ +
+ + +
+ +
+ + +
+

+

+
+ + + + +
+ + + +
+ + + +