renders item link with panorama

This commit is contained in:
buttle 2021-05-17 19:32:31 +02:00
parent dd5f653fcf
commit 286487db95
2 changed files with 7 additions and 0 deletions

View File

@ -92,6 +92,8 @@ class PanoramaViewer extends AbstractBlockLayout
array_push($thumbnails, $media->thumbnailUrls());
}
}
$item_id = $attachments[0]->item()->url();
$title = $attachments[0]->item()->title();
$width = $block->dataValue('width');
$height = $width / $block->dataValue('ratio');
return $view->partial('common/block-layout/panorama-viewer', [
@ -104,6 +106,8 @@ class PanoramaViewer extends AbstractBlockLayout
'id' => 'pv-' . ++$id,
'mediaTypes' => $media_types,
'thumbnails' => $thumbnails,
'item_url' => $attachments[0]->item()->url(),
'item_title' => $attachments[0]->item()->title(),
]);
}
}

View File

@ -47,6 +47,9 @@
<?php } else { ?>
<div id="<?= $id ?>" class="panorama-viewer"></div>
<?php } ?>
<div class="more-item-info">
<a href="<?= $item_url ?>"><?= $item_title ?></a>
</div>
</div>
<script>