Compare commits

...

10 Commits

Author SHA1 Message Date
a3a0fa4830 uploading the svg
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-12 10:20:58 +01:00
acce6379f0 handling previosu next posts specificities 2024-11-12 10:20:47 +01:00
554c2d1b1b some test for modifyng block name on the fly 2024-11-12 10:20:28 +01:00
224b0891b1 handling member phone 2024-11-12 10:19:01 +01:00
13b3ce8066 handling the cta slim 2024-11-12 10:18:36 +01:00
3eb98d97c1 handling 2 consecutives header for front page 2024-11-12 10:18:22 +01:00
e104b5b7e5 handling filters 2024-11-12 10:18:03 +01:00
c16e8734d1 handling filters 2024-11-12 10:17:57 +01:00
56984d12f2 modifying company members and handling company members phone gsm 2024-11-12 10:17:51 +01:00
1198242f44 handling classic page template 2024-11-12 10:17:27 +01:00
10 changed files with 202 additions and 80 deletions

43
page.php Normal file
View File

@ -0,0 +1,43 @@
<?php get_header(); ?>
<div class="homegrade-page-container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
<?php
$currentPage = get_post();
$parentPage = $currentPage->post_parent !== 0 ? get_post($currentPage->post_parent) : null;
$networkHomeUrl = network_home_url();
$frontPageUrl = get_home_url();
$frontPageTitle = get_the_title(get_option('page_on_front'));
?>
<ol>
<li>
<a href="<?php echo $networkHomeUrl ?>" title="<?php echo __("Accueil", "homegrade-theme__texte-fonctionnel") ?>">
<img src="<?php echo get_template_directory_uri() . "/resources/img/pictogrammes/icon_house_dark.svg" ?>" alt="">
</a>
</li>
<li><a href="<?php echo $frontPageUrl ?>"><?php echo $frontPageTitle ?></a></li>
<?php if ($parentPage) : ?>
<li><a href="<?php echo get_post_permalink($parentPage) ?>"><?php echo $parentPage->post_title ?></a></li>
<?php endif; ?>
<?php if ($currentPage) : ?>
<li><a href="<?php echo get_post_permalink($currentPage) ?>" aria-current="location" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
<?php endif; ?>
</ol>
</nav>
<?php
the_content();
?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php get_footer();

View File

@ -8,6 +8,7 @@
@import './base/shadows.css';
@import './base/cta.css';
@import './base/tags.css';
@import './base/filters.css';
/* EDITOR CONTENT */
@import './editor-content/color-scheme.css';
@ -18,9 +19,12 @@
/* COMPONENTS */
@import './components/heading-box.css';
@import './components/previous-next-posts.css';
/* BLOCKS */
@import './blocks/search-artisan-btn.css';
@import './blocks/cta-slim.css';
@import './blocks/content-page-header.css';
/* TEMPLATES */
@import '../../template-components/artisans/card-artisans.css';

View File

@ -0,0 +1,4 @@
.filter-patrimoine-sante-securite {
filter: invert(25%) sepia(79%) saturate(6075%)
hue-rotate(263deg) brightness(99%) contrast(96%);
}

View File

@ -0,0 +1,4 @@
.wp-block-homegrade-content-blocks-content-page-header
+ .wp-block-homegrade-content-blocks-content-page-header {
@apply mt-0 pt-0;
}

View File

@ -0,0 +1,9 @@
.homegrade-blocks-cta-slim {
&:after {
transform: translateY(1px);
content: url('../resources/img/graphic-assets/chevron-next.svg');
}
&:hover:after {
transform: translateY(1px) translateX(1px);
}
}

View File

@ -0,0 +1,9 @@
.previous-next-artisan {
.link-subtitle {
@apply font-bold text-patrimoine-sante-securite;
}
.link-subtitle,
.link-title {
@apply font-bold;
}
}

View File

@ -47,6 +47,13 @@
&__name {
@apply text-xl font-bold !my-0 text-patrimoine-sante-securite;
}
&__phone {
@apply font-bold flex items-center pt-1;
&:before {
@apply content-[''] block h-6 w-6 bg-contain bg-center bg-no-repeat mr-2;
background-image: url('../resources/img/pictogrammes/Homegrade_repertoire-telephone.svg');
}
}
&__description {
@apply pt-2;
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" width="2.6mm" height="3.7mm" viewBox="0 0 7.5 10.6">
<g id="Groupe_5602" data-name="Groupe 5602">
<path id="Tracé_162" data-name="Tracé 162" d="M1.4,9.2l5.1-3.9L1.4,1.4" style="fill: none; stroke: #8b2ff7; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 410 B

View File

@ -1,7 +1,28 @@
export default function editorInit() {
categoriesInit();
updateBlockCategory();
console.log(`updateBlockCategory`);
}
function updateBlockCategory() {
wp.hooks.addFilter(
'blocks.registerBlockType',
'homegrade-content-blocks/vocabulaire-summary',
(settings, name) => {
if (
name ===
'homegrade-content-blocks/vocabulaire-summary'
) {
return {
...settings,
title: 'Nouveau Titre du Bloc',
category: 'metiers-patrimoine-blocks', // Nouvelle catégorie souhaitée
};
}
return settings;
}
);
}
function categoriesInit() {
wp.blocks.updateCategory('metiers-patrimoine-blocks', {
icon: (

View File

@ -107,42 +107,57 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
<p><?php echo $company_description ?></p>
</section>
<section class="artisans-post__section artisans-post__section--team ">
<h2 class="artisans-post__section-title"><?php echo __("L'équipe", "metiers-patrimoine-theme") ?></h2>
<?php
$company_description = get_field('company_description');
$company_members = get_field('company_members');
?>
<?php foreach ($company_members as $member): ?>
<div class="artisan-member">
<img class="artisan-member__icon" src="<?php echo get_stylesheet_directory_uri() . '/resources/img/pictogrammes/Homegrade_repertoire-equipe.svg' ?>" alt="">
<h3 class="artisan-member__name"><?php echo $member['first_name'] . ' ' . $member['last_name'] ?></h3>
</div>
<p class="artisan-member__description"><?php echo $member['description'] ?></p>
<?php endforeach; ?>
<?php if ($company_members): ?>
<section class="artisans-post__section artisans-post__section--team ">
<h2 class="artisans-post__section-title"><?php echo __("L'équipe", "metiers-patrimoine-theme") ?></h2>
<?php
$company_description = get_field('company_description');
$company_members = get_field('company_members');
?>
<?php foreach ($company_members as $member): ?>
<?php
$member_gsm_number = $member['member_gsm_number'];
$formatted_member_gsm_number = preg_replace('/^(\+\d{2})(\d{3})(\d{2})(\d{2})(\d{2})$/', '$1 $2 $3 $4 $5', $member_gsm_number);
?>
<div class="artisan-member">
<img class="artisan-member__icon" src="<?php echo get_stylesheet_directory_uri() . '/resources/img/pictogrammes/Homegrade_repertoire-equipe.svg' ?>" alt="">
<div>
<h3 class="artisan-member__name"><?php echo $member['first_name'] . ' ' . $member['last_name'] ?></h3>
<?php if ($member_gsm_number): ?>
<a class="artisan-member__phone" href="tel:<?php echo $member_gsm_number ?>"><?php echo $formatted_member_gsm_number ?></a>
<?php endif; ?>
</div>
</div>
<p class="artisan-member__description"><?php echo $member['description'] ?></p>
<?php endforeach; ?>
</section>
<section class="artisans-post__section artisans-post__section--chantiers">
<h2 class="artisans-post__section-title"> <?php echo __(" Chantiers réalisés ", "metiers-patrimoine-theme") ?>
</h2>
</section>
<?php endif; ?>
<?php
$args = array(
'post_type' => 'chantiers',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'artisan',
'value' => $post->ID,
'compare' => 'LIKE'
)
<?php
$args = array(
'post_type' => 'chantiers',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'artisan',
'value' => $post->ID,
'compare' => 'LIKE'
)
);
$chantiers = new WP_Query($args);
?>
<?php if ($chantiers->posts): ?>
)
);
$chantiers = new WP_Query($args);
?>
<?php if ($chantiers->posts): ?>
<section class="artisans-post__section artisans-post__section--chantiers">
<h2 class="artisans-post__section-title"> <?php echo __(" Chantiers réalisés ", "metiers-patrimoine-theme") ?>
</h2>
<?php foreach ($chantiers->posts as $chantier): ?>
<?php
$chantier_description = get_field('description', $chantier->ID);
@ -159,68 +174,68 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
</div>
<p class="chantier__description"><?php echo $chantier_description ?></p>
<div class="chantier__photo-grid">
<?php
foreach ($pictures as $key => $picture) {
}
?>
<?php foreach ($pictures as $picture): ?>
<img src="<?php echo $picture['sizes']['large'] ?>" />
<?php endforeach; ?>
</div>
<?php
// Rendre Un bloc acf/lightbox-gallery avec les photos du chantier
$block_content = '<!-- wp:acf/lightbox-gallery {"data":{"gallery":' . json_encode($pictures) . '}} /-->';
echo do_blocks($block_content);
?>
</div>
<?php endforeach; ?>
</section>
<?php endif; ?>
</div>
</div>
<div class="previous-next-posts previous-next-artisan">
<?php
$prevPost = get_previous_post();
$nextPost = get_next_post();
?>
<?php if ($nextPost) : ?>
<?php $nextPostcover = get_the_post_thumbnail_url($nextPost->ID, 'full'); ?>
<a class="previous-next-posts__next previous-next-artisans__next" href="<?php echo get_the_permalink($nextPost->ID) ?>">
<div class="previous-next-posts__link-content previous-next-artisan__link-content">
<p class="link-subtitle"><?php echo __("Entreprise suivante ", "homegrade-theme__texte-fonctionnel") ?></p>
<p class="link-title"><?php echo $nextPost->post_title ?></p>
</div>
<?php if ($nextPostcover): ?>
<img class="previous-next-posts__post-thumbnail" src="<?php echo $nextPostcover ?>" alt="">
<?php endif; ?>
</a>
<?php endif; ?>
</section>
</div>
<?php if ($prevPost) : ?>
<?php $prevPostcover = get_the_post_thumbnail_url($prevPost->ID, 'full'); ?>
<a class="previous-next-posts__previous previous-next-artisan__previous" href="<?php echo get_the_permalink($prevPost->ID) ?>">
<?php if ($prevPostcover): ?>
<img class="previous-next-posts__post-thumbnail" src="<?php echo $prevPostcover ?>" alt="">
<?php endif; ?>
<div class="previous-next-posts__link-content previous-next-artisan__link-content">
<p class="link-subtitle"><?php echo __("Entreprise précédente ", "homegrade-theme__texte-fonctionnel") ?></p>
<p class="link-title"><?php echo $prevPost->post_title ?></p>
</div>
</a>
<?php endif; ?>
</div>
<?php
$prevPost = get_previous_post();
$nextPost = get_next_post();
// echo $prev_post->post_title;
// write_log($nextPost);
echo '<pre>';
print_r($prevPost);
echo '</pre>';
?>
<?php if ($nextPost) : ?>
<a class="previous-next-questions__next" href="<?php echo get_the_permalink($nextPost->ID) ?>">
<div class="previous-next-questions__link-content">
<p class="question_type"><?php echo __("Entreprise suivante ", "homegrade-theme__texte-fonctionnel") ?></p>
<p class="question_title"><?php echo $nextPost->post_title ?></p>
</div>
<img class="thematique_icon" src="<?php echo $thematique_icon['url'] ?>" alt="">
</a>
<?php endif; ?>
<?php if ($previousPost) : ?>
<a class="previous-next-questions__previous" href="<?php echo get_the_permalink($previousPost->ID) ?>">
<img class="thematique_icon" src="<?php echo $thematique_icon['url'] ?>" alt="">
<div class="previous-next-questions__link-content">
<p class="question_type"><?php echo __("Entreprise précédente ", "homegrade-theme__texte-fonctionnel") ?></p>
<p class="question_title"><?php echo $previousPost->post_title ?></p>
</div>
</a>
<?php endif; ?>
<?php
get_template_part('template-components/conseil-patrimoine-redirector', null, array());
?>