FEATURE Handling download pdf button

This commit is contained in:
Nonimart 2025-08-22 17:25:15 +02:00
parent a5447bd40e
commit f75eb529a9
2 changed files with 14 additions and 2 deletions

View File

@ -3,7 +3,7 @@
@apply col-span-2 container mx-auto; @apply col-span-2 container mx-auto;
.tablist { .tablist {
@apply flex gap-12 border-b border-primary; @apply flex items-center gap-12 border-b border-primary;
button { button {
@apply text-xl mt-8 nunito pb-4 flex items-center gap-4; @apply text-xl mt-8 nunito pb-4 flex items-center gap-4;
.icon { .icon {
@ -20,5 +20,9 @@
@apply text-black opacity-40; @apply text-black opacity-40;
} }
} }
a.cta--download-pdf {
@apply ml-auto;
}
} }
} }

View File

@ -5,7 +5,8 @@ $hasReferences = isset($reference) && is_array($reference) && count($reference)
$authors = get_field('authors', $id); $authors = get_field('authors', $id);
$hasAuthors = isset($authors) && is_array($authors) && count($authors) > 0; $hasAuthors = isset($authors) && is_array($authors) && count($authors) > 0;
$pdf_version = get_field('pdf_version', $id);
$pdf_url = isset($pdf_version) ? $pdf_version['url'] : null;
?> ?>
@ -35,5 +36,12 @@ $hasAuthors = isset($authors) && is_array($authors) && count($authors) > 0;
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-note-biographique.svg" alt=""> <img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-note-biographique.svg" alt="">
Informations Informations
</button> </button>
<?php if ($pdf_url) : ?>
<a id="tab-6" href="<?php echo $pdf_url; ?>" target="_blank" class="cta cta--classic cta--has-icon cta--rounded cta--download-pdf ">
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-fleche-telecharger.svg" alt="">
PDF
</a>
<?php endif; ?>
</div> </div>
</div> </div>