From 477376af4d4b9b3fb5c56c28c26e9dae5890a602 Mon Sep 17 00:00:00 2001 From: Nonimart Date: Wed, 15 Oct 2025 11:36:46 +0200 Subject: [PATCH] FEATURE Introducing the Search results page and behaviour --- resources/css/app.css | 3 +- resources/css/components/post-count.css | 12 ++++ resources/css/pages/search-results.css | 79 +++++++++++++++++++++++++ search.php | 62 ++++++++++++++----- searchform.php | 5 ++ 5 files changed, 145 insertions(+), 16 deletions(-) create mode 100644 resources/css/components/post-count.css create mode 100644 resources/css/pages/search-results.css diff --git a/resources/css/app.css b/resources/css/app.css index 74db281..da3ab56 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -15,7 +15,6 @@ @import './components/news-card.css'; @import './components/post-grid.css'; @import './components/footnote-reference.css'; - @import './components/revues-grid.css'; @import './components/articles-grid.css'; @import './components/post-card.css'; @@ -35,6 +34,7 @@ @import './components/article-references.css'; @import './components/article-informations.css'; @import './components/search-module.css'; +@import './components/post-count.css'; /* ########### PAGES ############ */ @import './pages/singles.css'; @@ -43,6 +43,7 @@ @import './pages/archive-articles.css'; @import './pages/single-articles.css'; @import './pages/single-auteurs.css'; +@import './pages/search-results.css'; /* ########### LAYOUT ############ */ @import './layout/nav.css'; diff --git a/resources/css/components/post-count.css b/resources/css/components/post-count.css new file mode 100644 index 0000000..39bf774 --- /dev/null +++ b/resources/css/components/post-count.css @@ -0,0 +1,12 @@ +.post-count { + @apply flex items-center gap-2 text-primary; + + &__count { + @apply font-normal uppercase fjalla text-4xl; + line-height: 0.8; + } + + &__text { + @apply text-lg nunito font-normal; + } +} diff --git a/resources/css/pages/search-results.css b/resources/css/pages/search-results.css new file mode 100644 index 0000000..66fba51 --- /dev/null +++ b/resources/css/pages/search-results.css @@ -0,0 +1,79 @@ +.search-results-page { + &__page-header { + @apply bg-primary text-white py-16; + + .inner { + @apply max-w-7xl mx-auto; + } + p, + h1, + h2, + h3, + h4, + h5, + h6 { + @apply !text-white; + } + + a { + @apply text-white; + } + } + + &__results-container { + @apply max-w-2xl mx-auto mt-16; + @apply flex flex-col gap-8; + } + + &__results-counter { + @apply mb-4; + } + + .search-results-card { + @apply bg-white p-8 border border-primary; + @apply transition-shadow hover:shadow-lg; + + h2 { + @apply mb-4; + + a { + @apply text-primary hover:underline; + } + } + + &__link { + @apply inline-block mt-4 text-primary font-semibold; + @apply hover:underline; + } + } + + .search-results-pagination { + @apply mt-12 mb-8; + + .pagination { + @apply flex justify-center items-center gap-2; + } + + .page-numbers { + @apply px-4 py-2 border border-gray-300 rounded; + @apply transition-colors; + + &:hover { + @apply bg-primary text-white border-primary; + } + + &.current { + @apply bg-primary text-white border-primary; + } + } + + .prev, + .next { + @apply font-semibold; + } + } + + .no-results { + @apply text-center text-gray-600 py-12; + } +} diff --git a/search.php b/search.php index 4004135..50e3de7 100644 --- a/search.php +++ b/search.php @@ -1,30 +1,62 @@ -
+
-
-
-
-

-

- +
+
+ + +
+

Rechercher

+

+ «  » -

+

+
- + " alt="">
- - - +
+

+ found_posts; ?> + résultats +

+
+ + +
+ +

+ +

+
+ +
+ + → + + +
+ + +
+ 2, + 'prev_text' => __('« Précédent', 'homegrade-theme__texte-fonctionnel'), + 'next_text' => __('Suivant »', 'homegrade-theme__texte-fonctionnel'), + )); + ?> +
+ + +

diff --git a/searchform.php b/searchform.php index 6a6e5bd..3fc9277 100644 --- a/searchform.php +++ b/searchform.php @@ -6,6 +6,11 @@ + + + + +