Compare commits

..

12 Commits

Author SHA1 Message Date
Antoine M
15a6976c4c REMOVE unused logging statement in archive presse card component
All checks were successful
continuous-integration/drone/push Build is passing
2026-05-13 11:58:07 +02:00
Antoine M
fe14cc2ad2 FEATURE Adapting content meta to handle dynamiques posts 2026-05-13 11:57:54 +02:00
Antoine M
e9bc938e20 FEATURE Styling the component 2026-05-13 11:57:10 +02:00
Antoine M
a93eaff635 STYLE Responsive optimisation 2026-05-13 11:56:56 +02:00
Antoine M
c9a90db0d6 FIX responsiveness and overflow on body while trying to keep a working sticky sidebar 2026-05-13 11:56:35 +02:00
Antoine M
ebc42c9fca STYLE PAdding fix 2026-05-13 11:56:04 +02:00
Antoine M
2ed7952a71 STYLE tiny adaptation 2026-05-13 11:55:53 +02:00
Antoine M
14fe284679 FEATURE Handling the collective access button redirection 2026-05-13 11:55:30 +02:00
Antoine M
f6111ab21b Handling a Slider card declination for featured news 2026-05-13 11:54:35 +02:00
Antoine M
f0a5c07d0a FEATURE HAndling analyses-etudes extyernal link exception 2026-05-13 11:53:56 +02:00
Antoine M
4cdc50ed5d STYLE Refining aspect 2026-05-13 11:53:22 +02:00
Antoine M
b9d90b9106 REFINE Remove logging from build_posts function in API 2026-05-13 11:51:51 +02:00
17 changed files with 275 additions and 25 deletions

View File

@ -7,8 +7,9 @@ $current_post_type = get_post_type();
<main id="content" class="site-content flex-grow">
<?php get_template_part('template-parts/post-types/fonds-archives/archive-header'); ?>
<?php get_template_part('template-parts/components/collective-acess-button'); ?>
<!-- #### ARCHIVE POST GRID #### -->
<?php get_template_part('template-parts/post-types/fonds-archives/archive-post-grid', null, array(

View File

@ -35,13 +35,7 @@ function build_posts($request)
'posts_per_page' => $posts_per_page,
);
write_log(array(
'post_type' => $post_type,
'etiquette' => $etiquette,
'auteur' => $auteur,
'sort_by' => $sort_by,
'recherche' => $recherche,
));
// Gestion du tri
switch ($sort_by) {

View File

@ -442,3 +442,25 @@ function get_current_post_numerotation($post_id)
return null;
}
function is_a_collections_page()
{
$collection_parent_page_id = 83;
$current_page_id = (int) get_queried_object_id();
if ($collection_parent_page_id === $current_page_id || $is_fond_archive_fonds_archives) {
return true;
}
if ($current_page_id) {
$ancestors = get_post_ancestors($current_page_id, 'page');
if (in_array($collection_parent_page_id, array_map('intval', $ancestors), true)) {
return true;
}
}
return false;
}

View File

@ -6,6 +6,9 @@
while (have_posts()) :
the_post();
the_content();
if (is_a_collections_page()) {
get_template_part('template-parts/components/collective-acess-button');
}
?>

View File

@ -50,7 +50,8 @@
@import './components/content-wrapper.css';
@import './components/content-area.css';
@import './components/authors-list.css';
@import './components/collective-access-button.css';
@import './components/slider-card.css';
@import './components/buttons/load-more.css';
/* ########### EDITOR CONTENT ############ */

View File

@ -3,9 +3,17 @@ a {
@apply text-primary;
}
body{
max-width: 100vw;
overflow-x: hidden;
}
main {
/* Causing issues with the article sidebar index sticky positioning */
/* overflow-x: hidden; */
/* overflow-x: hidden; */
/* overflow-y: clip; */
max-width: 100vw;
& > :last-child {
margin-bottom: 0px !important;

View File

@ -59,12 +59,12 @@
&.alignwide,
&.aligncontained {
@apply !mx-auto;
@apply md:!mx-auto;
}
&.aligncontained {
/* max-width: calc(960px - 4rem) !important; */
@apply !max-w-screen-lg;
@apply !max-w-screen-lg ;
}
&.alignwide {
@media (max-width: 767px) {

View File

@ -1,5 +1,5 @@
.featured-news {
@apply bg-carhop-blue-50 py-20 !my-0;
@apply bg-carhop-blue-50 py-20 !my-0 px-4 md:px-10 ;
.swiper-actions-wrapper,
.swiper-pagination-fraction,
@ -7,6 +7,11 @@
@apply px-4 md:px-20;
}
.swiper-pagination,
.swiper-pagination-fraction{
@apply !px-0;
}
.swiper-wrapper {
@apply items-end;
}

View File

@ -0,0 +1,10 @@
.collective-access-button {
@apply bg-white text-primary px-4 py-4 block w-32 shadow-2xl ;
@apply w-fit top-1/2 right-0 z-50 fixed;
box-sizing: content-box;
transform-origin: center top;
transform: translateY(0%) rotate(-90deg) translateY(55%);
}

View File

@ -83,7 +83,8 @@
height: 1px;
}
&__input {
&__input.search-module__search-form__input {
box-sizing: border-box;
@apply block max-w-full w-full flex-grow !py-4 !border-white px-4 !pl-12 focus-visible:ring-primary focus-visible:ring-2;
@apply border rounded-none;
@ -93,6 +94,10 @@
border-bottom-left-radius: 999px;
border: 1px solid; */
&:focus-visible {
@apply !pl-12
}
/* box-shadow: 0 0 1px 0px white inset, 0 0 1px 0px white; */
}
button[type='submit'] {
@ -108,7 +113,7 @@
&__searchbar-group {
@apply w-full flex flex-col md:flex-row gap-y-4 relative;
&:before {
@apply content-[''] absolute inset-0 bg-contain bg-center bg-no-repeat w-6 h-6 left-4 top-1/2 -translate-y-1/2;
@apply content-[''] absolute inset-0 bg-contain bg-center bg-no-repeat w-6 h-6 left-4 top-1/2 -translate-y-1/2 z-20;
background-image: url('../resources/img/icons/carhop-rechercher.svg');
filter: invert(1);
}
@ -126,3 +131,12 @@
body:has(.search-module[opened]) main {
filter: blur(2px) brightness(0.8);
}
body.front-end form:not(:has(.gfield)) {
.search-module__search-form__input:focus-visible,
.search-module__search-form__input{
@apply !pl-12
}
}

View File

@ -0,0 +1,86 @@
.slider-card {
@apply p-6 relative !flex flex-col pt-16;
svg {
@apply absolute top-0 left-0 w-full h-full overflow-visible;
z-index: -1;
path {
stroke-width: 0;
vector-effect: non-scaling-stroke;
}
}
&:hover {
svg {
path {
stroke-width: 6px;
}
}
&:after {
opacity: 1;
}
.slider-card__link-button {
svg {
@apply translate-x-2;
}
}
}
&__link-button {
@apply block mt-8;
width: 100px;
height: 100px;
svg {
transition: transform 0.3s ease-in-out;
path,
circle {
@apply stroke-primary;
}
}
}
.content-meta {
@apply text-primary;
}
&__title {
@apply text-2xl font-medium uppercase pb-4 ;
}
&__link{
/* @apply mb-12;
&:has(+ .slider-card__date) {
@apply mb-0;
} */
}
*:has(+ .slider-card__cover) {
@apply mb-16;
}
&__tags {
@apply flex flex-wrap gap-4 pt-4;
}
&__cover {
@apply w-40 h-40 absolute border-primary border bottom-12 right-12 hidden lg:block;
transform: rotate(-3deg);
img {
@apply w-full h-full object-cover p-3;
}
}
.cta--go {
@apply text-primary mt-auto;
}
&:has(.slider-card__link:hover) {
.cta--go {
img {
@apply translate-x-2;
}
}
}
}

View File

@ -343,7 +343,7 @@ body:has(.primary-menu-container .sub-menu-open) {
.menu-item-object-custom.item-catalogue {
a {
@apply flex flex-col items-center justify-center gap-4;
@apply flex lg:flex-col items-center lg:justify-center gap-4;
}
a:before {
@apply content-[''] block bg-contain bg-center bg-no-repeat;

View File

@ -82,7 +82,7 @@ $media_types_list = array(
<?php
$amount = $media_type['amount'];
$media_type = $media_type['acf_fc_layout'];
write_log($media_type);
if (!$amount || !$media_type) continue;
?>
<li class="media-type media-type--<?php echo esc_attr($media_type); ?>"><?php echo $amount . ' ' . ($media_types_list[$media_type] ?? $media_type) . ($amount > 1 ? 's' : ''); ?></li>

View File

@ -36,6 +36,28 @@ $description = get_field('description', $ID);
$birth_death_date = get_field('birth_death_date', $ID);
if($current_post_type === 'analyses-etudes'){
$type_analyse_etude = get_the_terms($ID, 'type-analyse-etude')[0] ?? null;
if($type_analyse_etude->slug === 'analyse'){
$link_type = get_field('link_type', $ID);
$target = '_blank' ;
switch($link_type){
case 'pdf':
$link = get_field('pdf', $ID)['url'] ?? '';
break;
case 'link':
$link = get_field('link', $ID)['url'] ?? '';
break;
default:
$link = get_the_permalink($ID);
break;
}
}
}
?>
<a class="post-card post-card--<?php echo $current_post_type . ' ' . ($has_post_thumbnail ? 'post-card--has-thumbnail' : ''); ?> card" href="<?php echo esc_url($link); ?>" target="<?php echo $target; ?>">

View File

@ -0,0 +1,60 @@
<?php
$postID = $args['ID'];
$isSwiperSlide = $args['isSwiperSlide'] ?? false;
$showCover = $args['showCover'] ?? false;
$cover = get_the_post_thumbnail_url($postID);
$current_post_type = get_post_type($postID);
$showTags= $args['showTags'] ?? true;
?>
<div class="slider-card <?php echo $isSwiperSlide ? 'swiper-slide' : ''; ?>">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type,
'current_post_id' => $postID
)); ?>
<a href="<?php echo get_the_permalink($postID); ?>" class="slider-card__link">
<h4 class="slider-card__title"><?php echo get_the_title($postID); ?></h4>
</a>
<?php if ($showTags) : ?>
<ul class="slider-card__tags">
<?php
$terms = get_the_terms($postID, 'etiquettes');
if ($terms): ?>
<?php foreach ($terms as $term): ?>
<li class="slider-card__tag slider-tag">
<a href="<?php echo add_query_arg('etiquette', $term->slug, get_post_type_archive_link('articles')); ?>">
<?php echo esc_html($term->name); ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<?php endif; ?>
<time datetime="<?php echo get_the_date('c', $postID); ?>" class="slider-card__date"><?php echo get_the_date('d F Y', $postID); ?></time>
<?php if ($showCover && isset($cover) && $cover) : ?>
<div class="slider-card__cover">
<img src="<?php echo $cover; ?>" alt="<?php echo get_the_title($postID); ?>">
</div>
<?php endif; ?>
<?php get_template_part('template-parts/components/cta--go', null, array(
'url' => get_the_permalink($postID),
'label' => 'Lire la revue',
'target' => '_self',
)); ?>
<?php
$svg_path = get_template_directory() . '/resources/img/elements/fond-biseau.svg';
if (file_exists($svg_path)) {
echo file_get_contents($svg_path);
}
?>
</div>

View File

@ -0,0 +1,15 @@
<?php
/**
* Collective Access Button
*
* @package Carhop
* @subpackage Components
* @since 1.0.0
*/
?>
<a href="https://collectiveaccess.org" class="collective-access-button" target="_blank">
<span class="collective-access-button-text">
Collective Access
</span>
</a>

View File

@ -3,20 +3,31 @@ $current_post_id = $args['current_post_id'] ?? get_the_ID();
$current_post_type = $args['current_post_type'] ?? null;
$type = null;
$current_post_type_supports_type = get_post_type_supports_type($current_post_type);
$is_dynamiques_post_type = $current_post_type === 'revues' || $current_post_type === 'articles';
$hasNumerotation = hasPostTypeNumerotation($current_post_type);
if ($current_post_type_supports_type) {
if ($is_dynamiques_post_type) {
$current_post_type_obj = get_post_type_object($current_post_type);
$dynamiques_post_type_labels = array(
'revues' => __('Revue', 'carhop'),
'articles' => __('Article', 'carhop'),
);
$type = $current_post_type_obj->labels->singular_name ?? $dynamiques_post_type_labels[$current_post_type] ?? null;
}
else if ($current_post_type_supports_type) {
// $type = isset($types_terms[0]) ? $types_terms[0] : null;
$type_term = get_post_specific_type_terms($current_post_id)[0] ?? null;
if ($type_term) {
$type = $type_term->name;
}
// $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
} else {
}
else {
$current_post_type_obj = get_post_type_object($current_post_type);
$type = $current_post_type_obj->labels->singular_name;
$type = $current_post_type_obj->labels->singular_name ?? null;
}
?>
@ -28,8 +39,6 @@ if ($current_post_type_supports_type) {
<?php if ($hasNumerotation) : ?>
<?php
$numerotation = get_current_post_numerotation($current_post_id);
?>
<p class="content-meta__revue-issue content-meta__revue-issue--green">