hadnling conditionnal document download button

This commit is contained in:
Antoine M 2023-11-28 17:01:47 +01:00
parent dff18dd97f
commit 252a76a317

View File

@ -122,9 +122,9 @@ $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_pos
$highlightedDocumentDatas = get_field('highlighted_document', $current_page_id) ?? null;
$documentThumbnail = get_field('brochure_cover_image', $highlightedDocumentDatas['document']['ID']);
?>
<?php if ($highlightedDocumentDatas) : ?>
<div class="highlighted-publication__infos">
<div class="highlighted-publication__titling">
@ -139,12 +139,14 @@ $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_pos
<?php if ($highlightedDocumentDatas['commentary']) : ?>
<div class="highlighted-publication__comment"><?php echo $highlightedDocumentDatas['commentary'] ?></div>
<?php endif; ?>
<a class="cta cta--secondary cta--button" href="<?php echo $highlightedBrochurePdf['url'] ?>" target="_blank"><?php echo __("Consulter le PDF", "homegrade-theme__texte-fonctionnel__archive-publications") ?></a>
<?php if ($highlightedDocumentDatas['document']) : ?>
<a class="cta cta--secondary cta--button" href="<?php echo $highlightedDocumentDatas['document']['url'] ?>" target="_blank"><?php echo __("Consulter le PDF", "homegrade-theme__texte-fonctionnel__archive-publications") ?></a>
<?php endif; ?>
</div>
<?php if ($documentThumbnail) : ?>
<img class="highlighted-publication__cover" src='<?php echo $documentThumbnail['sizes']['large'] ?>' />
<?php endif; ?>
 
<?php endif; ?>
</div>