Compare commits

...

21 Commits

Author SHA1 Message Date
Antoine M
d426369c14 REFACTOR Importing dynamic fse compositionsfor soutenir and infolettre to increase flexibilty and simplify user modifications
All checks were successful
continuous-integration/drone/push Build is passing
2026-03-03 17:19:05 +01:00
Antoine M
6ee828e3db STYLE Add imports for member contact card and single activites page CSS 2026-03-03 17:15:11 +01:00
Antoine M
9677efae34 FEATURE introducing component styling 2026-03-03 17:15:00 +01:00
Antoine M
62e0417eca STYLE Update notice panel CSS to remove bottom margin on last child element 2026-03-03 17:14:37 +01:00
Antoine M
1901f23601 FEATURE Handling page activites special buttons 2026-03-03 17:14:19 +01:00
Antoine M
ecdd5b86de FEATURE Adapting card to handle post thumbnail 2026-03-03 17:13:58 +01:00
Antoine M
0cff1ce71c FEATURE Adapting style for detail tag 2026-03-03 17:13:50 +01:00
Antoine M
3b01d8ec55 FEATURE Introducing data handling and page for activites post type 2026-03-03 17:13:31 +01:00
Antoine M
1be5cf1d1b FEATURE Adapting card to handle post thumbnail 2026-03-03 17:13:18 +01:00
Antoine M
332d905a32 FEATURE Introducing the component 2026-03-03 17:12:56 +01:00
Antoine M
74a1c30417 REAFACTOR Adapting query with the new type-analyse-etude taxonomy 2026-03-03 17:12:44 +01:00
Antoine M
b70102e465 FEATURE Introducing data handling and page for activites post type 2026-03-03 17:12:00 +01:00
Antoine M
d263267b82 FEATURE Introducing component 2026-03-03 17:06:22 +01:00
Antoine M
e8929c9c07 FEATURE Introducing component 2026-03-03 17:06:03 +01:00
Antoine M
e8b7520ef5 FEATURE Handling different types multiple taxonomies 2026-03-03 17:05:52 +01:00
Antoine M
7205e75f89 FEATURE Introducing reusable composition-based components 2026-03-03 17:04:25 +01:00
Antoine M
de78d6e4cd REFACTOR Removing unecessary write_log 2026-03-03 17:03:39 +01:00
Antoine M
56e1be0251 REFACTOR cleaning and removing debug logging and unnecessary conditions for menu item handling 2026-03-03 17:03:22 +01:00
Antoine M
0045513e8e FEATURE Handling different type display for multiple post types 2026-03-03 17:02:46 +01:00
Antoine M
7d9e53a076 UPLOAD assets 2026-03-03 17:01:17 +01:00
Antoine M
094c75bf7d FEATURE Handling thumbnail and post date label variations 2026-03-03 17:01:08 +01:00
35 changed files with 613 additions and 114 deletions

29
archive-activites.php Normal file
View File

@ -0,0 +1,29 @@
<?php get_header(); ?>
<?php
$current_post_type = get_post_type();
?>
<main id="content" class="site-content flex-grow">
<?php get_template_part('template-parts/post-types/activites/archive-header'); ?>
<!-- #### ACTIVITÉS POST GRID #### -->
<?php get_template_part('template-parts/components/archive/post-grid', null, array(
'current_post_type' => 'activites',
'post_amount' => -1,
'grid_title' => 'Trouver une activité',
)); ?>
<!-- #### SOUTENIR #### -->
<?php get_template_part('template-parts/compositions/soutenir'); ?>
<!-- #### INFOLETTRE #### -->
<?php get_template_part('template-parts/compositions/infolettre'); ?>
</main>
<?php
get_footer();

View File

@ -26,24 +26,11 @@ $current_post_type = get_post_type();
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
<?php get_template_part('template-parts/compositions/soutenir'); ?>
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
<?php get_template_part('template-parts/compositions/infolettre'); ?>
</main>
<?php

View File

@ -28,25 +28,12 @@
<?php get_template_part('template-parts/post-types/analyses-etudes/analyses-etudes-grid'); ?>
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
<?php get_template_part('template-parts/compositions/soutenir'); ?>
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
<?php get_template_part('template-parts/compositions/infolettre'); ?>
?>
</main>

View File

@ -26,24 +26,11 @@ $current_post_type = get_post_type();
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
<?php get_template_part('template-parts/compositions/soutenir'); ?>
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
<?php get_template_part('template-parts/compositions/infolettre'); ?>
</main>
<?php

View File

@ -27,24 +27,11 @@ $current_post_type = get_post_type();
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
<?php get_template_part('template-parts/compositions/soutenir'); ?>
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
<?php get_template_part('template-parts/compositions/infolettre'); ?>
</main>
<?php

View File

@ -15,24 +15,11 @@ $current_post_type = get_post_type();
<?php get_template_part('template-parts/expositions/archive-latest-parutions', null, array()); ?>
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
<?php get_template_part('template-parts/compositions/soutenir'); ?>
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
<?php get_template_part('template-parts/compositions/infolettre'); ?>
</main>
<?php

View File

@ -30,22 +30,11 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
$subtitle_html = '<span class="page_subtitle">' . $page_subtitle . '</span>';
if ($item->url === 'https://carhop.local/a-propos/equipe/') {
write_log($item);
write_log($subtitle_html);
write_log($icon_html);
// $icon_html = get_archive_page_icon_html($item->object);
// $subtitle_html = get_archive_page_subtitle_html($item->object);
}
if ($item->type === 'post_type_archive') {
$icon_html = get_archive_page_icon_html($item->object);
$subtitle_html = get_archive_page_subtitle_html($item->object);
}
if ($item->ID === 494) {
write_log($item);
}
$output = '<a href="' . $item->url . '" class="menu-item__content">' . $icon_html . '<div class="menu-item__content-inner"><p class="menu-item__title">' . $item->title . '</p>' . $subtitle_html . '</div></a>';
return $output;
}

View File

@ -120,7 +120,7 @@ function get_last_analyses_etudes_posts()
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'taxonomy' => 'type-analyse-etude',
'field' => 'slug',
'terms' => 'analyse',
),
@ -134,7 +134,7 @@ function get_last_analyses_etudes_posts()
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'taxonomy' => 'type-analyse-etude',
'field' => 'slug',
'terms' => 'etude',
),
@ -273,3 +273,53 @@ function count_user_posts_by_author($userID, $postType)
$query = new WP_Query($args);
return $query->found_posts;
}
function get_activity_title_from_acf_layout_label($label)
{
switch ($label) {
case 'public_cible':
return __('Public cible', 'carhop');
case 'lieu':
return __('Lieu', 'carhop');
case 'date':
return __('Date', 'carhop');
case 'duree':
return __('Durée', 'carhop');
case 'prix':
return __('Prix', 'carhop');
default:
return '';
}
}
function get_post_type_supports_type($post_type)
{
switch ($post_type) {
case 'activites':
case 'analyses-etudes':
return true;
default:
return false;
}
}
function get_post_specific_type_terms($post_id)
{
$post_type = get_post_type($post_id);
$terms = null;
switch ($post_type) {
case 'activites':
$terms = get_the_terms($post_id, 'type-activite');
return $terms;
case 'analyses-etudes':
$terms = get_the_terms($post_id, 'type-analyse-etude');
return $terms;
}
return $terms;
}

View File

@ -36,6 +36,7 @@
@import './components/search-module.css';
@import './components/author-card.css';
@import './components/member-card.css';
@import './components/member-contact-card.css';
@import './components/tablist.css';
@import './components/post-card.css';
@import './components/post-grid.css';
@ -67,6 +68,7 @@
@import './pages/archives.css';
@import './pages/singles.css';
@import './pages/single-auteurs.css';
@import './pages/single-activites.css';
/* ########### BLOCKS ############ */
@import './blocks/blocks-spacing.css';

View File

@ -15,7 +15,7 @@
}
> .innerblocks > :last-child {
@apply !pb-0;
@apply !pb-0 !mb-0;
}
}
}

View File

@ -81,4 +81,30 @@
content: none !important;
}
}
&--demander-formation,
&--programme,
&--subscribe {
&:after {
content: none !important;
}
&:before {
@apply content-[''] w-6 h-6 ml-2 inline-block;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
&:hover {
&:before {
@apply filter-white;
}
}
}
&--subscribe:before,
&--demander-formation:before {
background-image: url('../resources/img/icons/carhop-reproduction.svg');
}
&--programme:before {
background-image: url('../resources/img/icons/carhop-programme.svg');
}
}

View File

@ -19,6 +19,7 @@
@apply rounded-full bg-white border-2 border-primary;
}
&--articles:before,
&--activites:before,
&--article:before {
@apply w-6 bg-carhop-purple-300 -rotate-45;
}

View File

@ -0,0 +1,48 @@
.member-contact-card {
@apply flex sm:grid flex-col gap-y-4 w-full border border-primary p-6 mb-12 sm:items-center bg-white;
grid-template-columns: auto 1fr;
gap: 1rem;
transition: all 0.3s ease-in-out;
&:hover {
@apply translate-y-[-4px];
}
&__profile-picture {
@apply w-32 h-32 object-cover p-2 border border-primary;
img {
@apply w-full h-full object-cover;
}
&--placeholder {
@apply bg-carhop-green-100 flex items-center justify-center;
&:before {
content: '';
@apply block w-6 h-6 filter-primary;
background-image: url('../resources/img/icons/icon-losange.svg');
background-size: contain;
background-repeat: no-repeat !important;
background-position: center;
}
}
&-placeholder {
@apply w-full h-full bg-carhop-green-100 relative;
}
}
&__description {
@apply col-span-2 text-primary;
}
&__infos {
@apply w-full flex flex-col md:flex-row flex-wrap justify-start md:justify-between gap-x-2 gap-y-4 md:items-center;
.member-contact-card__name {
@apply text-2xl uppercase font-medium tracking-normal;
}
.member-card__email {
@apply !m-0;
}
}
}

View File

@ -5,6 +5,25 @@
transform: translateY(-4px);
}
&--has-thumbnail {
@apply grid gap-6;
grid-template-columns: 1fr 3fr;
}
&__thumbnail {
@apply bg-white border border-solid border-primary p-2 h-fit grayscale hover:grayscale-0;
transition: all 0.3s ease-out;
img {
aspect-ratio: 108/137;
@apply w-full bg-green-400 object-cover;
height: auto;
}
}
&:hover .post-card__thumbnail {
@apply !grayscale-0;
}
h3.card__title {
@apply mb-6;
}

View File

@ -8,7 +8,7 @@
}
&__main-author {
@apply text-white font-light tracking-wide flex items-center gap-3 mt-4;
&::before {
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain;
content: '';
@ -25,7 +25,21 @@
@apply container;
}
@apply max-w-screen-2xl mx-auto;
&--has-thumbnail {
/* &--has-thumbnail {
@screen lg {
grid-template-columns: 4fr 1fr;
}
} */
&--thumbnail-left {
@apply gap-4;
@screen lg {
grid-template-columns: 1fr 4fr;
}
}
&--thumbnail-right {
.thumbnail-wrapper {
@apply order-2 lg:order-1;
}
@screen lg {
grid-template-columns: 4fr 1fr;
}
@ -41,7 +55,7 @@
@apply text-white;
}
.thumbnail-wrapper {
@apply order-2 lg:order-1 relative z-20 h-fit;
@apply relative z-20 h-fit;
width: calc(100% - 40px);
padding: 1.2rem;
/* max-width: calc(70% - 40px);
@ -59,7 +73,7 @@
img {
aspect-ratio: 4/5;
/* max-height: 200px; */
@apply max-h-[200px] lg:max-h-full h-full relative z-10;
@apply max-h-[200px] lg:max-h-full h-full w-full relative z-10;
@apply object-cover;
/* width: calc(100% - 2rem);

View File

@ -85,3 +85,16 @@ article > *:not(.entry-content),
}
}
}
details {
@apply mb-32;
&:has(+ details) {
@apply mb-6;
}
&:has(+ h1, + h2, + h3, + h4, + h5, + h6) {
@apply mb-12;
}
summary {
@apply text-primary;
}
}

View File

@ -0,0 +1,63 @@
.page-single--activites {
.content-wrapper {
grid-template-columns: 3fr 1.3fr;
@media (max-width: 1024px) {
grid-template-columns: 1fr;
aside {
order: -1;
}
}
}
.sidebar-single-activites {
@apply p-6 border border-primary text-primary;
&__title-container {
@apply mb-8 border-b border-primary;
h2.sidebar-single-activites__title {
@apply relative flex items-center gap-3 w-fit pb-4 nunito capitalize font-bold text-xl tracking-normal;
&::before,
&::after {
content: ' ';
@apply block;
}
&::before {
@apply w-8 h-8;
background-image: url('../resources/img/icons/carhop-resume-green.svg');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
&::after {
@apply w-full h-1 absolute left-0 border-b-2 border-primary bottom-0;
@apply mr-2;
}
}
}
h4 {
@apply nunito font-bold text-lg tracking-widest;
}
.cta {
@apply text-base px-3 pr-5 font-semibold;
}
&__informations {
@apply mt-4;
li + li {
@apply mt-4;
}
}
&__buttons {
@apply mt-6;
li {
@apply mt-0;
}
@apply flex gap-4;
}
}
}

View File

@ -0,0 +1,29 @@
<svg width="295" height="268" viewBox="0 0 295 268" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M190.638 1.01976e-05L21.6309 165.647L125.811 267.755L294.818 102.108L190.638 1.01976e-05Z" fill="#D6C3FF"/>
<rect y="187.885" width="59.9261" height="59.9261" fill="white"/>
<rect x="216.305" y="142.96" width="59.9261" height="59.9261" fill="white"/>
<rect x="93.1777" y="21.4969" width="58.3065" height="59.9261" fill="white"/>
<path d="M249 157.522V179.189L255.75 172.008L262.5 178.654V157.522H249Z" stroke="#136F63" stroke-width="2"/>
<path d="M256.5 172.522V189.189H229.582L229.5 170.931L242.755 157.522L248.667 163.633" stroke="#136F63" stroke-width="2"/>
<g clip-path="url(#clip0_2999_18574)">
<path d="M138.208 40.5778H108.047V68.6939H138.208V40.5778Z" stroke="#136F63" stroke-width="2"/>
<path d="M142.051 32.5356H104.201V40.5778H142.051V32.5356Z" stroke="#136F63" stroke-width="2"/>
<path d="M123.268 57.4749V45" stroke="#136F63" stroke-width="2"/>
<path d="M116.402 50.5198L123.268 57.475L129.821 50.8364" stroke="#136F63" stroke-width="2"/>
<path d="M115.818 61.8866H130.404" stroke="#136F63" stroke-width="2"/>
</g>
<g clip-path="url(#clip1_2999_18574)">
<path d="M37.8888 210.295H12.6738V214.897V236.762H37.8888V210.295Z" stroke="#136F63" stroke-width="2"/>
<path d="M37.8886 230.467H45.5609V202.234H18.6719V210.295" stroke="#136F63" stroke-width="2"/>
<path d="M25.2754 217.67V229.387" stroke="#136F63" stroke-width="2"/>
<path d="M31.0782 223.529H19.4824" stroke="#136F63" stroke-width="2"/>
</g>
<defs>
<clipPath id="clip0_2999_18574">
<rect width="39.933" height="38.2692" fill="white" transform="translate(103.16 31.4802)"/>
</clipPath>
<clipPath id="clip1_2999_18574">
<rect width="34.9414" height="36.6053" fill="white" transform="translate(11.6465 201.196)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,13 @@
<svg width="22" height="26" viewBox="0 0 22 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_3036_16005)">
<path d="M16.4759 20.6592H0.736328V17.1902V0.703613H16.4759V20.6592Z" stroke="#136F63" stroke-width="2"/>
<path d="M16.4765 5.44629H21.2639V25.2964H4.47852V20.6593" stroke="#136F63" stroke-width="2"/>
<path d="M12.6461 16.2473H4.56641" stroke="#136F63" stroke-width="2"/>
<path d="M12.6895 4.32043H4.52148V10.2171H12.6895V4.32043Z" stroke="#136F63" stroke-width="2"/>
</g>
<defs>
<clipPath id="clip0_3036_16005">
<rect width="22" height="26" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 619 B

View File

@ -0,0 +1,13 @@
<svg width="25" height="26" viewBox="0 0 25 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2138_19837)">
<path d="M18.7752 6.46313H0.734375V9.73158V25.2622H18.7752V6.46313Z" stroke="#136F63" stroke-width="2"/>
<path d="M18.7747 20.7911H24.2641V0.737793H5.02539V6.46311" stroke="#136F63" stroke-width="2"/>
<path d="M9.75195 11.7014V20.0238" stroke="#136F63" stroke-width="2"/>
<path d="M13.904 15.8627H5.60742" stroke="#136F63" stroke-width="2"/>
</g>
<defs>
<clipPath id="clip0_2138_19837">
<rect width="25" height="26" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 593 B

View File

@ -0,0 +1,13 @@
<svg width="26" height="28" viewBox="0 0 26 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2660_15853)">
<path d="M25.9993 9.58704H7.16992" stroke="#136F63" stroke-width="2"/>
<path d="M25.9993 27.2312H7.16992" stroke="#136F63" stroke-width="2"/>
<path d="M18.7608 0.768799H0" stroke="#136F63" stroke-width="2"/>
<path d="M20.7567 18.413H7.16992" stroke="#136F63" stroke-width="2"/>
</g>
<defs>
<clipPath id="clip0_2660_15853">
<rect width="26" height="28" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 529 B

62
single-activites.php Normal file
View File

@ -0,0 +1,62 @@
<?php get_header(); ?>
<?php
$postType = get_post_type();
?>
<div class="page-single page-single--<?php echo $postType; ?>" data-article-id="<?php echo get_the_ID(); ?>">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/components/posts/post-header', null, array(
'post_date_info_label' => 'Publication'
)); ?>
<div class="content-wrapper" data-active-tab="post">
<div class="content-area">
<?php get_template_part('template-parts/components/posts/post-content', null, array(
'ID' => get_the_ID()
)); ?>
<?php get_template_part('template-parts/components/posts/post-authors', null, array(
'postId' => get_the_ID()
)); ?>
</div>
<aside class="sidebar">
<?php get_template_part('template-parts/post-types/activites/sidebar-single-activites'); ?>
</aside>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php
$type = get_post_specific_type_terms(get_the_ID())[0] ?? null;
if (isset($type) && ($type->slug === 'formation-archives' || $type->slug === 'formation-histoire')) {
get_template_part('template-parts/compositions/formation-sur-demande');
}
if (isset($type) && ($type->slug === 'conference')) {
get_template_part('template-parts/compositions/conferences-sur-demande');
}
if (isset($type) && ($type->slug === 'animation')) {
get_template_part('template-parts/compositions/animation-sur-demande');
}
?>
<?php get_template_part('template-parts/compositions/soutenir'); ?>
<?php get_template_part('template-parts/compositions/infolettre'); ?>
</div>
<?php
get_footer();

View File

@ -32,7 +32,6 @@ if ($redirect_to_author_page) {
));
$card_permalink = isset($corresponding_author_id[0]->ID) ? get_the_permalink($corresponding_author_id[0]->ID) : '#';
write_log($card_permalink);
restore_current_blog();
}

View File

@ -0,0 +1,46 @@
<?php
$member_id = $args['member_id'];
switch_to_blog(1);
$member_full_name = get_the_title($member_id);
$member_thumbnail = get_field('profile_thumbnail', $member_id);
$member_thumbnail_url = $member_thumbnail['url'] ?? '';
$member_thumbnail_alt = $member_thumbnail['alt'] ?? '';
$member_description = get_field('description', $member_id);
$member_email = get_field('email', $member_id);
restore_current_blog();
?>
<div href="<?php echo $link; ?>" class="member-contact-card">
<div class="member-contact-card__profile-picture">
<?php if ($member_thumbnail_url) : ?>
<img src="<?php echo $member_thumbnail_url; ?>" alt="<?php echo $member_thumbnail_alt; ?>">
<?php else : ?>
<div class="member-contact-card__profile-picture-placeholder"></div>
<?php endif; ?>
</div>
<div class="member-contact-card__infos">
<h3 class="member-contact-card__name"><?php echo $member_full_name; ?></h3>
<?php if ($member_email) : ?>
<a href="mailto:<?php echo $member_email; ?>" class="member-contact-card_email cta cta--classic cta--rounded cta--has-icon cta--mailing">
<div class="cta__icon">
<?php $mail_svg_path = get_template_directory() . '/resources/img/icons/carhop-mail.svg';
if (file_exists($mail_svg_path)) {
echo file_get_contents($mail_svg_path);
} ?>
</div>
Envoyer un email
</a>
<?php endif; ?>
</div>
<div class="member-contact-card__description">
<?php echo $member_description; ?>
</div>
</div>

View File

@ -1,14 +1,15 @@
<?php
$ID = $args['ID'] ?? null;
$current_post_type = $args['current_post_type'] ?? get_post_type();
$types_terms = get_the_terms($ID, 'type');
$type = isset($types_terms[0]) ? $types_terms[0] : null;
$title = get_the_title($ID);
$showExcerpt = $args['show_excerpt'] ?? false;
$excerpt = get_the_excerpt($ID);
$link = get_the_permalink($ID);
$image = get_the_post_thumbnail_url($ID);
$has_post_thumbnail = has_post_thumbnail($ID);
$thumbnail_url = get_the_post_thumbnail_url($ID) ?? null;
$date = get_the_date('F Y', $ID);
$authors = get_field('authors', $ID);
@ -20,13 +21,17 @@ $tags = get_the_terms($ID, 'etiquettes');
?>
<a class="post-card post-card--<?php echo $current_post_type; ?> card" href="<?php echo $link; ?>">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type,
'current_post_id' => $ID
)); ?>
<a class="post-card post-card--<?php echo $current_post_type . ' ' . ($has_post_thumbnail ? 'post-card--has-thumbnail' : ''); ?> card" href="<?php echo $link; ?> ">
<?php if ($has_post_thumbnail) : ?>
<div class="post-card__thumbnail">
<img src="<?php echo $thumbnail_url; ?>" alt="<?php echo $title; ?>">
</div>
<?php endif; ?>
<div class="card__inner">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type,
'current_post_id' => $ID
)); ?>
<div class="card__content">
<h3 class="card__title"><?php echo $title; ?></h3>
<?php if ($showExcerpt) : ?>

View File

@ -2,11 +2,14 @@
$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 = is_object_in_taxonomy($current_post_type, 'type');
$current_post_type_supports_type = get_post_type_supports_type($current_post_type);
$hasNumerotation = hasPostTypeNumerotation($current_post_type);
if ($current_post_type_supports_type) {
$type_term = get_the_terms($current_post_id, 'type')[0] ?? null;
// $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;
}
@ -17,7 +20,6 @@ if ($current_post_type_supports_type) {
}
?>
<div class="content-meta">
<?php if ($type) : ?>
<span class="content-meta__type content-meta__type--<?php echo $current_post_type ?>"><?php echo $type ?></span>

View File

@ -6,8 +6,9 @@ $postTitle = get_the_title($post_id);
$hasNumerotation = hasPostTypeNumerotation($post_id);
$hasThumbnail = has_post_thumbnail();
$authors = get_field('authors', $ID);
$post_date_info_label = $args['post_date_info_label'] ?? 'Parution';
$thumbnail_position = $args['thumbnail_position'] ?? 'left';
$has_thumbnail_overlay = $args['has_thumbnail_overlay'] ?? false;
?>
<?php if ($hasNumerotation) : ?>
@ -20,7 +21,7 @@ $authors = get_field('authors', $ID);
<?php endif; ?>
<section class="post-header post-header--<?php echo $post_type; ?> ">
<div class="post-header__inner post-header__inner--<?php echo $hasThumbnail ? 'has-thumbnail' : 'no-thumbnail'; ?> ">
<div class="post-header__inner post-header__inner--<?php echo $hasThumbnail ? 'has-thumbnail post-header__inner--thumbnail-' . $thumbnail_position : 'no-thumbnail'; ?> ">
<?php if ($hasThumbnail) : ?>
<div class="thumbnail-wrapper">
@ -31,13 +32,13 @@ $authors = get_field('authors', $ID);
'style' => 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';'
]);
?>
<div class="thumbnail-overlay"></div>
<?php if ($has_thumbnail_overlay) : ?>
<div class="thumbnail-overlay"></div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="content">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_id' => $post_id,
'current_post_type' => $post_type
@ -52,9 +53,11 @@ $authors = get_field('authors', $ID);
<div class="post-details">
<div class="post-meta">
<div class="post-date-info">
<p class="post-details__label">Parution</p>
<p class="post-details__label"><?php echo $post_date_info_label; ?></p>
<time class="post-details__value" datetime="<?php echo get_the_date('Y-m-d', $currentRevueID); ?>"><?php echo get_the_date('d F Y', $currentRevueID); ?></time>
</div>
</div>

View File

@ -0,0 +1,9 @@
<!-- #### ANIMATION SUR DEMANDE #### -->
<?php
$composition_id = 1560;
$animation_sur_demande_content = get_post_field('post_content', $composition_id);
if ($animation_sur_demande_content) {
echo do_blocks($animation_sur_demande_content);
}
?>

View File

@ -0,0 +1,9 @@
<!-- #### CONFERENCES SUR DEMANDE #### -->
<?php
$composition_id = 1559;
$conferences_sur_demande_content = get_post_field('post_content', $composition_id);
if ($conferences_sur_demande_content) {
echo do_blocks($conferences_sur_demande_content);
}
?>

View File

@ -0,0 +1,9 @@
<!-- #### FORMATION SUR DEMANDE #### -->
<?php
$composition_id = 1540;
$formation_sur_demande_content = get_post_field('post_content', $composition_id);
if ($formation_sur_demande_content) {
echo do_blocks($formation_sur_demande_content);
}
?>

View File

@ -0,0 +1,9 @@
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$infolettre_content = get_post_field('post_content', $composition_id);
if ($infolettre_content) {
echo do_blocks($infolettre_content);
}
?>

View File

@ -0,0 +1,9 @@
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>

View File

@ -0,0 +1,11 @@
<?php get_template_part('template-parts/page-header', null, array(
'title' => 'Catalogue des activités',
'subtitle' => 'Apprendre, partager et débattre avec le CARHOP',
'description' => 'Un catalogue danimations, de formations et de conférences proposées par le CARHOP.',
'cover' => array(
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/cover-catalogue-activites.svg',
'alt' => 'Revues'
),
'background_style' => 'sliced',
));

View File

@ -0,0 +1,69 @@
<?php
$post_id = get_the_ID();
$activity_informations = get_field('activity_informations', $post_id);
$buttons_links = get_field('buttons_links', $post_id);
?>
<aside class="sidebar-single-activites">
<div class="sidebar-single-activites__title-container">
<h2 class="sidebar-single-activites__title">
<?php _e('Informations', 'carhop'); ?>
</h2>
</div>
<ul class="sidebar-single-activites__informations">
<?php foreach ($activity_informations as $activity_information) : ?>
<?php
$custom_title = isset($activity_information['title']) ? $activity_information['title'] : null;
$title = $custom_title ?? get_activity_title_from_acf_layout_label($activity_information['acf_fc_layout'], $post_id) ?? null;
?>
<li>
<?php if ($title) : ?>
<h4 class="sidebar-single-activites__label">
<?php echo $title; ?>
</h4>
<?php endif; ?>
<p class="sidebar-single-activites__description">
<?php echo $activity_information['description']; ?>
</p>
</li>
<?php endforeach; ?>
</ul>
<?php if (!empty($buttons_links)) : ?>
<ul class="sidebar-single-activites__buttons">
<?php foreach ($buttons_links as $button_link) : ?>
<li>
<?php if ($button_link['acf_fc_layout'] === 'demander_formation') : ?>
<a href="mailto:<?php echo $button_link['email'] ?>" class="cta cta--classic cta--rounded cta--has-icon button cta--demander-formation">
Demander une formation
</a>
<?php endif; ?>
<?php if ($button_link['acf_fc_layout'] === 'programme' && $button_link['programme_type'] === 'url') : ?>
<a href="<?php echo $button_link['link'] ?>" target="_blank" class="cta cta--classic cta--rounded cta--has-icon button cta--programme">
Programme
</a>
<?php endif; ?>
<?php if ($button_link['acf_fc_layout'] === 'programme' && $button_link['programme_type'] === 'pdf') : ?>
<a href="<?php echo $button_link['file']['url'] ?>" target="_blank" class="cta cta--classic cta--rounded cta--has-icon button cta--programme">
Programme
</a>
<?php endif; ?>
<?php if ($button_link['acf_fc_layout'] === 'subscribe') : ?>
<a href="<?php echo $button_link['link'] ?>" target="_blank" class="cta cta--classic cta--rounded cta--has-icon button cta--subscribe">
Sinscrire
</a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</aside>

View File

@ -10,7 +10,7 @@ $authors = get_posts(array(
));
$types = get_terms(array(
'taxonomy' => 'type',
'taxonomy' => 'type-analyse-etude',
'hide_empty' => true,
));