From 1cec7773accf036d9bf123fad5616baf7d38c0cc Mon Sep 17 00:00:00 2001 From: Antoine M Date: Mon, 20 Nov 2023 14:13:26 +0100 Subject: [PATCH] refining puclications page --- .../pages/template-archive-publications.css | 98 +++--- template-publications.php | 297 +++++++++++++----- 2 files changed, 264 insertions(+), 131 deletions(-) diff --git a/resources/css/pages/template-archive-publications.css b/resources/css/pages/template-archive-publications.css index 0c758c9..8b53f32 100644 --- a/resources/css/pages/template-archive-publications.css +++ b/resources/css/pages/template-archive-publications.css @@ -1,62 +1,52 @@ -.archives-publications-header { - @apply bg-primary max-w-screen-xl text-white text-center mx-auto; -} - -.highlighted-brochure { - @apply max-w-screen-xl - p-8 - mx-auto - mt-0 - bg-secondary-light; - - /* &__infos { - &:after { - @apply absolute - left-0 - bottom-0 - w-full - bg-secondary-light; - content: ''; - height: 200px; - z-index: -1; - } - } */ - &__wrapper { - @apply relative +.template-archives--publications { + .archives-publications-header { + @apply bg-primary max-w-screen-xl text-white text-center mx-auto; + } + .highlighted-publication { + @apply max-w-screen-xl + mb-10 + p-8 + mx-auto + rounded-2xl + bg-secondary-light flex flex-row - items-end - justify-between; - } - &__titling { - @apply flex items-center gap-4; - &__icon { - @apply bg-secondary rounded-full w-8 h-8 flex items-center justify-center; - img { - @apply w-full; - max-width: 40%; + items-center + justify-around; + &__infos { + } + + &__titling { + @apply flex items-center gap-4 w-fit; + &__icon { + @apply bg-secondary rounded-full w-8 h-8 flex items-center justify-center; + img { + @apply w-full; + max-width: 40%; + } + } + &__title { + @apply font-bold text-secondary text-xl; } } - &__title { - @apply font-bold text-secondary text-xl; + &__comment { + @apply pt-4 max-w-3xl pr-6 text-secondary; + + line-height: 1.6; + } + + &__cover { + /* transform: translateY(-30%); */ + @apply rounded-2xl; + max-width: 200px; + /* transform: scale(2) translate(-50%, -20%); */ + } + .cta { + @apply mt-8; } } - &__comment { - @apply pt-4 w-2/3 max-w-5xl pr-6; - } - - &__cover { - @apply absolute right-0 bottom-0; - /* transform: translateY(-30%); */ - @apply w-1/3; - max-width: 250px; - /* transform: scale(2) translate(-50%, -20%); */ - } - .cta { - @apply mt-8; + .brochures-archives, + .fiches-infos-archives { + @apply max-w-screen-xl mx-auto py-4 mt-8; } } -.brochures-archives, -.fiches-infos-archives { - @apply max-w-screen-xl mx-auto py-4 mt-8; -} diff --git a/template-publications.php b/template-publications.php index e94ab44..fbb9940 100644 --- a/template-publications.php +++ b/template-publications.php @@ -1,9 +1,66 @@ 'brochures', + 'posts_per_page' => $posts_per_page, + 'post_status' => 'publish', + 'order' => 'DESC', + 'orderby' => 'date', + 'meta_key' => 'brochure_pdf', + 'meta_value' => '', + 'meta_compare' => '!=', + // ICI METAQUERY FOR LE PDF +); +$brochuresPosts = new WP_Query($args); + + +// #### FICHES INFOS QUERY +$args = array( + 'post_type' => 'fiches-infos', + 'posts_per_page' => $posts_per_page, + 'post_status' => 'publish', + 'order' => 'DESC', + 'orderby' => 'date', + 'meta_key' => 'brochure_pdf', + 'meta_value' => '', + 'meta_compare' => '!=', + // ICI METAQUERY FOR LE PDF +); +$fichesInfosPosts = new WP_Query($args); + + + +// #### VIDÉOS & WEBINAIRES QUERY +$args = array( + 'post_type' => 'fiches-infos', + 'posts_per_page' => $posts_per_page, + 'post_status' => 'publish', + 'order' => 'DESC', + 'orderby' => 'date', + 'meta_key' => 'brochure_pdf', + 'meta_value' => '', + 'meta_compare' => '!=', + // ICI METAQUERY FOR LE PDF +); +$fichesInfosPosts = new WP_Query($args); + +$total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_posts + 100; + + ?>
+ -
-

-

-

- -
+ ID) ?? null; - $highlightedBrochureCover = get_field('brochure_cover_image', $highlightedBrochurePdf['ID']) ?? null; - $highlightedBrochureComment = get_field('highlighted_brochure_comment', $current_page_id) ?? null; + get_template_part("template-components/heading-box", null, array( + "pageIcon" => $pageIcon, + "title" => get_the_title(get_queried_object_id()), + "description" => __("Découvrez toutes nos publications et outils en ligne", "homegrade-theme__texte-fonctionnel"), + )); ?> - -
-
-
-
-
- -
-

- -

-
+ +
+

+ + found_posts ?> + + + + - -

- - -
- - ' /> - -
-
- + + + + + + +

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

Curabitur eleifend neque eu erat lacinia tincidunt

- 'brochures', - 'posts_per_page' => 1, - 'post_status' => 'publish', - 'order' => 'DESC', - 'orderby' => 'date', - 'meta_key' => 'brochure_pdf', - 'meta_value' => '', - 'meta_compare' => '!=', - // ICI METAQUERY FOR LE PDF - ); - $brochures = new WP_Query($args); - + $highlightedBrochureRelatedPost = get_field('highlighted_brochure', $current_page_id) ?? null; + $highlightedBrochurePdf = get_field('brochure_pdf', $highlightedBrochureRelatedPost->ID) ?? null; + $highlightedBrochureCover = get_field('brochure_cover_image', $highlightedBrochurePdf['ID']) ?? null; + $highlightedBrochureComment = get_field('highlighted_brochure_comment', $current_page_id) ?? null; ?> + +
+
+ +
+
+ +
+

+ +

+
+ + +

+ + +
+ + ' /> + + +
+ +
    - have_posts()) : while ($brochures->have_posts()) : $brochures->the_post(); ?> + have_posts()) : while ($brochuresPosts->have_posts()) : $brochuresPosts->the_post(); ?> get_the_ID())); + $brochurePdf = get_field('brochure_pdf', $args['ID']); + $brochureCover = get_field('brochure_cover_image', $brochurePdf['ID']); + $brochureEdition = get_field('brochure_edition', $args['ID']); + $thematique = get_the_terms($args['ID'], 'thematiques')[0]; + $rootThematic = getParentThematique($thematique); ?> + +
  • + + + +

    +

    name ?>

    + + +

    + +
    + +
    +
  • + - - -
@@ -93,49 +204,82 @@ $current_page_id = get_queried_object_id();
- +

Phasellus elit turpis, viverra id porta gravida

- 'fiches-infos', - 'posts_per_page' => 1, - 'post_status' => 'publish', - 'order' => 'DESC', - 'orderby' => 'date', - 'meta_key' => 'brochure_pdf', - 'meta_value' => '', - 'meta_compare' => '!=', - // ICI METAQUERY FOR LE PDF - ); - $fiches_infos = new WP_Query($args); - - ?>
    - have_posts()) : while ($fiches_infos->have_posts()) : $fiches_infos->the_post(); ?> + have_posts()) : while ($fichesInfosPosts->have_posts()) : $fichesInfosPosts->the_post(); ?> term_id)['icon'] ?? null; ?>
  • -

    missing the cover

    - - + + + -

    -

    name ?>

    +

    +

    name ?>

    + +

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

+

Phasellus elit turpis, viverra id porta gravida

+
+ + +
    + have_posts()) : while ($fichesInfosPosts->have_posts()) : $fichesInfosPosts->the_post(); ?> + + term_id)['icon'] ?? null; + ?> +
  • + + + + +

    +

    name ?>

    @@ -154,7 +298,6 @@ $current_page_id = get_queried_object_id(); -