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/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';
|
||||
|
|
|
|||
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 {
|
||||
@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;
|
||||
}
|
||||
|
|
|
|||
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() {
|
||||
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: (
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
<p><?php echo $company_description ?></p>
|
||||
|
||||
</section>
|
||||
|
||||
<?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>
|
||||
|
||||
|
|
@ -115,18 +117,27 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
$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>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
|
|
@ -143,6 +154,10 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
$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,69 +174,69 @@ $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) {
|
||||
}
|
||||
// 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);
|
||||
?>
|
||||
|
||||
<?php foreach ($pictures as $picture): ?>
|
||||
<img src="<?php echo $picture['sizes']['large'] ?>" />
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="previous-next-posts previous-next-artisan">
|
||||
|
||||
<?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>
|
||||
<?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>
|
||||
<img class="thematique_icon" src="<?php echo $thematique_icon['url'] ?>" alt="">
|
||||
<?php if ($nextPostcover): ?>
|
||||
<img class="previous-next-posts__post-thumbnail" src="<?php echo $nextPostcover ?>" alt="">
|
||||
<?php endif; ?>
|
||||
</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>
|
||||
<?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
|
||||
|
||||
|
||||
|
||||
|
||||
get_template_part('template-components/conseil-patrimoine-redirector', null, array());
|
||||
?>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user