initial commit on forge variable
This commit is contained in:
parent
388079e6bb
commit
581d60f883
63 changed files with 518 additions and 34500 deletions
|
|
@ -3,32 +3,39 @@
|
|||
/** @var \Kirby\Cms\Block $block */
|
||||
$alt = $block->alt();
|
||||
$caption = $block->caption();
|
||||
$crop = $block->crop()->toBool();
|
||||
$link = $block->link();
|
||||
$ratio = $block->ratio()->or('auto');
|
||||
$src = null;
|
||||
|
||||
if ($block->location() == 'web') {
|
||||
$src = $block->src()->esc();
|
||||
} elseif ($image = $block->image()->toFile()) {
|
||||
$alt = $alt->or($image->alt());
|
||||
$src = $image->url();
|
||||
}
|
||||
$src = $block->image()->toFile()->url();
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($src): ?>
|
||||
<figure
|
||||
data-crop="<?= $crop ? 'true' : 'false' ?>"
|
||||
data-ratio="<?= $ratio ?>"
|
||||
style="--ratio: <?= $ratio ?>;"
|
||||
>
|
||||
<?php if ($link->isNotEmpty()): ?>
|
||||
<a href="<?= Str::esc($link->toUrl()) ?>">
|
||||
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>">
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<figure class="web-image">
|
||||
|
||||
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>">
|
||||
|
||||
<?php if ($caption->isNotEmpty()): ?>
|
||||
<figcaption>
|
||||
<?= $caption->kt() ?>
|
||||
</figcaption>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
|
||||
<figure class="print-image full-page" style="height:<?= $block->image()->toFile()->height()?>px">
|
||||
<?php if($srcred = $block->imagered()->toFile()):?>
|
||||
<div class="print-red red-layer">
|
||||
<img src="<?= $srcred->url() ?>" alt="<?= $alt->esc() ?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php if($srcgreen = $block->imagegreen()->toFile()):?>
|
||||
<div class="print-green green-layer">
|
||||
<img src="<?= $srcgreen->url() ?>" alt="<?= $alt->esc() ?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php if($srcblue = $block->imageblue()->toFile()):?>
|
||||
<div class="print-blue blue-layer">
|
||||
<img src="<?= $srcblue->url() ?>" alt="<?= $alt->esc() ?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<?php if ($caption->isNotEmpty()): ?>
|
||||
<figcaption>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue