mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Add blog post
This commit is contained in:
parent
7a3c7ad503
commit
97021ce26d
7 changed files with 140 additions and 35 deletions
22
templates/EbookCarousel.php
Normal file
22
templates/EbookCarousel.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?
|
||||
/**
|
||||
* @var array<Ebook> $carousel
|
||||
*/
|
||||
|
||||
$isMultiSize = $isMultiSize ?? false;
|
||||
?>
|
||||
<? if(sizeof($carousel) > 0){ ?>
|
||||
<ul class="ebook-carousel<? if($isMultiSize){ ?> multi-size<? } ?>">
|
||||
<? foreach($carousel as $carouselEbook){ ?>
|
||||
<li>
|
||||
<a href="<?= $carouselEbook->Url ?>">
|
||||
<picture>
|
||||
<? if($carouselEbook->CoverImage2xAvifUrl !== null){ ?><source srcset="<?= $carouselEbook->CoverImage2xAvifUrl ?> 2x, <?= $carouselEbook->CoverImageAvifUrl ?> 1x" type="image/avif"/><? } ?>
|
||||
<source srcset="<?= $carouselEbook->CoverImage2xUrl ?> 2x, <?= $carouselEbook->CoverImageUrl ?> 1x" type="image/jpg"/>
|
||||
<img src="<?= $carouselEbook->CoverImageUrl ?>" alt="<?= Formatter::EscapeHtml(strip_tags($carouselEbook->TitleWithCreditsHtml)) ?>" height="200" width="134" loading="lazy"/>
|
||||
</picture>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } ?>
|
Loading…
Add table
Add a link
Reference in a new issue