Compare commits
10 Commits
90a9d05c6f
...
a3a0fa4830
| Author | SHA1 | Date | |
|---|---|---|---|
| a3a0fa4830 | |||
| acce6379f0 | |||
| 554c2d1b1b | |||
| 224b0891b1 | |||
| 13b3ce8066 | |||
| 3eb98d97c1 | |||
| e104b5b7e5 | |||
| c16e8734d1 | |||
| 56984d12f2 | |||
| 1198242f44 |
43
page.php
Normal file
43
page.php
Normal 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();
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
@import './base/shadows.css';
|
@import './base/shadows.css';
|
||||||
@import './base/cta.css';
|
@import './base/cta.css';
|
||||||
@import './base/tags.css';
|
@import './base/tags.css';
|
||||||
|
@import './base/filters.css';
|
||||||
|
|
||||||
/* EDITOR CONTENT */
|
/* EDITOR CONTENT */
|
||||||
@import './editor-content/color-scheme.css';
|
@import './editor-content/color-scheme.css';
|
||||||
|
|
@ -18,9 +19,12 @@
|
||||||
|
|
||||||
/* COMPONENTS */
|
/* COMPONENTS */
|
||||||
@import './components/heading-box.css';
|
@import './components/heading-box.css';
|
||||||
|
@import './components/previous-next-posts.css';
|
||||||
|
|
||||||
/* BLOCKS */
|
/* BLOCKS */
|
||||||
@import './blocks/search-artisan-btn.css';
|
@import './blocks/search-artisan-btn.css';
|
||||||
|
@import './blocks/cta-slim.css';
|
||||||
|
@import './blocks/content-page-header.css';
|
||||||
|
|
||||||
/* TEMPLATES */
|
/* TEMPLATES */
|
||||||
@import '../../template-components/artisans/card-artisans.css';
|
@import '../../template-components/artisans/card-artisans.css';
|
||||||
|
|
|
||||||
4
resources/css/base/filters.css
Normal file
4
resources/css/base/filters.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
.filter-patrimoine-sante-securite {
|
||||||
|
filter: invert(25%) sepia(79%) saturate(6075%)
|
||||||
|
hue-rotate(263deg) brightness(99%) contrast(96%);
|
||||||
|
}
|
||||||
4
resources/css/blocks/content-page-header.css
Normal file
4
resources/css/blocks/content-page-header.css
Normal 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;
|
||||||
|
}
|
||||||
9
resources/css/blocks/cta-slim.css
Normal file
9
resources/css/blocks/cta-slim.css
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
resources/css/components/previous-next-posts.css
Normal file
9
resources/css/components/previous-next-posts.css
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
.previous-next-artisan {
|
||||||
|
.link-subtitle {
|
||||||
|
@apply font-bold text-patrimoine-sante-securite;
|
||||||
|
}
|
||||||
|
.link-subtitle,
|
||||||
|
.link-title {
|
||||||
|
@apply font-bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -47,6 +47,13 @@
|
||||||
&__name {
|
&__name {
|
||||||
@apply text-xl font-bold !my-0 text-patrimoine-sante-securite;
|
@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 {
|
&__description {
|
||||||
@apply pt-2;
|
@apply pt-2;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
resources/img/graphic-assets/chevron-next.svg
Normal file
6
resources/img/graphic-assets/chevron-next.svg
Normal 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 |
|
|
@ -1,7 +1,28 @@
|
||||||
export default function editorInit() {
|
export default function editorInit() {
|
||||||
categoriesInit();
|
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() {
|
function categoriesInit() {
|
||||||
wp.blocks.updateCategory('metiers-patrimoine-blocks', {
|
wp.blocks.updateCategory('metiers-patrimoine-blocks', {
|
||||||
icon: (
|
icon: (
|
||||||
|
|
|
||||||
|
|
@ -107,42 +107,57 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||||
<p><?php echo $company_description ?></p>
|
<p><?php echo $company_description ?></p>
|
||||||
|
|
||||||
</section>
|
</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
|
<?php if ($company_members): ?>
|
||||||
$company_description = get_field('company_description');
|
<section class="artisans-post__section artisans-post__section--team ">
|
||||||
$company_members = get_field('company_members');
|
<h2 class="artisans-post__section-title"><?php echo __("L'équipe", "metiers-patrimoine-theme") ?></h2>
|
||||||
?>
|
|
||||||
<?php foreach ($company_members as $member): ?>
|
<?php
|
||||||
<div class="artisan-member">
|
$company_description = get_field('company_description');
|
||||||
<img class="artisan-member__icon" src="<?php echo get_stylesheet_directory_uri() . '/resources/img/pictogrammes/Homegrade_repertoire-equipe.svg' ?>" alt="">
|
$company_members = get_field('company_members');
|
||||||
<h3 class="artisan-member__name"><?php echo $member['first_name'] . ' ' . $member['last_name'] ?></h3>
|
?>
|
||||||
</div>
|
<?php foreach ($company_members as $member): ?>
|
||||||
<p class="artisan-member__description"><?php echo $member['description'] ?></p>
|
<?php
|
||||||
<?php endforeach; ?>
|
$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>
|
||||||
<section class="artisans-post__section artisans-post__section--chantiers">
|
<?php endif; ?>
|
||||||
<h2 class="artisans-post__section-title"> <?php echo __(" Chantiers réalisés ", "metiers-patrimoine-theme") ?>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$args = array(
|
<?php
|
||||||
'post_type' => 'chantiers',
|
$args = array(
|
||||||
'posts_per_page' => -1,
|
'post_type' => 'chantiers',
|
||||||
'meta_query' => array(
|
'posts_per_page' => -1,
|
||||||
array(
|
'meta_query' => array(
|
||||||
'key' => 'artisan',
|
array(
|
||||||
'value' => $post->ID,
|
'key' => 'artisan',
|
||||||
'compare' => 'LIKE'
|
'value' => $post->ID,
|
||||||
)
|
'compare' => 'LIKE'
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
$chantiers = new WP_Query($args);
|
);
|
||||||
?>
|
$chantiers = new WP_Query($args);
|
||||||
<?php if ($chantiers->posts): ?>
|
?>
|
||||||
|
<?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 foreach ($chantiers->posts as $chantier): ?>
|
||||||
<?php
|
<?php
|
||||||
$chantier_description = get_field('description', $chantier->ID);
|
$chantier_description = get_field('description', $chantier->ID);
|
||||||
|
|
@ -159,68 +174,68 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||||
</div>
|
</div>
|
||||||
<p class="chantier__description"><?php echo $chantier_description ?></p>
|
<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): ?>
|
<?php
|
||||||
<img src="<?php echo $picture['sizes']['large'] ?>" />
|
// Rendre Un bloc acf/lightbox-gallery avec les photos du chantier
|
||||||
<?php endforeach; ?>
|
$block_content = '<!-- wp:acf/lightbox-gallery {"data":{"gallery":' . json_encode($pictures) . '}} /-->';
|
||||||
</div>
|
echo do_blocks($block_content);
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?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) ?>">
|
||||||
</section>
|
<?php if ($prevPostcover): ?>
|
||||||
|
<img class="previous-next-posts__post-thumbnail" src="<?php echo $prevPostcover ?>" alt="">
|
||||||
</div>
|
<?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>
|
</div>
|
||||||
<?php
|
<?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());
|
get_template_part('template-components/conseil-patrimoine-redirector', null, array());
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user