From 569b21ad1d9952e5023fed39208e2744921edf3d Mon Sep 17 00:00:00 2001 From: buttle Date: Sun, 27 Jun 2021 16:15:17 +0200 Subject: [PATCH] fixes layout --- src/Site/BlockLayout/PanoramaViewer.php | 6 +- .../common/block-layout/panorama-viewer.phtml | 92 +++++++++---------- 2 files changed, 45 insertions(+), 53 deletions(-) diff --git a/src/Site/BlockLayout/PanoramaViewer.php b/src/Site/BlockLayout/PanoramaViewer.php index bd1a616..efd0138 100644 --- a/src/Site/BlockLayout/PanoramaViewer.php +++ b/src/Site/BlockLayout/PanoramaViewer.php @@ -94,12 +94,13 @@ class PanoramaViewer extends AbstractBlockLayout } } $item_id = $attachments[0]->item()->url(); - $title = $attachments[0]->item()->title(); + //$title = $attachments[0]->item()->title(); + $title = $block->dataValue('title'); $width = $block->dataValue('width'); $height = $width / $block->dataValue('ratio'); return $view->partial('common/block-layout/panorama-viewer', [ 'panorama_type' => $panorama_type, - 'title' => $block->dataValue('title'), + 'title' => $title, 'width' => $width, 'height' => $height, 'autoLoad' => $block->dataValue('autoLoad'), @@ -109,7 +110,6 @@ class PanoramaViewer extends AbstractBlockLayout 'mediaTypes' => $media_types, 'thumbnails' => $thumbnails, 'item_url' => $attachments[0]->item()->url(), - 'item_title' => $attachments[0]->item()->title(), ]); } } diff --git a/view/common/block-layout/panorama-viewer.phtml b/view/common/block-layout/panorama-viewer.phtml index e462fa2..a4f80b5 100644 --- a/view/common/block-layout/panorama-viewer.phtml +++ b/view/common/block-layout/panorama-viewer.phtml @@ -1,40 +1,41 @@ +headLink()->appendStylesheet($this->assetUrl('vendor/pannellum/pannellum.css', + 'PanoramaViewer')); + $this->headScript()->appendFile($this->assetUrl('vendor/pannellum/pannellum.js', + 'PanoramaViewer')); + + if ($panorama_type == "video") { + $this->headLink()->appendStylesheet($this->assetUrl('vendor/video.js/video-js.css', + 'PanoramaViewer')); + $this->headScript()->appendFile($this->assetUrl('vendor/video.js/video.js', + 'PanoramaViewer')); + $this->headScript()->appendFile($this->assetUrl('vendor/pannellum/videojs-pannellum-plugin.js', + 'PanoramaViewer')); + } + if ($title !== false && $title !== "") { + $title = sprintf('

%s

', $title); + } else { + $title = false; + } +?> + + +
- headLink()->appendStylesheet($this->assetUrl('vendor/pannellum/pannellum.css', - 'PanoramaViewer')); - $this->headScript()->appendFile($this->assetUrl('vendor/pannellum/pannellum.js', - 'PanoramaViewer')); - - if ($panorama_type == "video") { - $this->headLink()->appendStylesheet($this->assetUrl('vendor/video.js/video-js.css', - 'PanoramaViewer')); - $this->headScript()->appendFile($this->assetUrl('vendor/video.js/video.js', - 'PanoramaViewer')); - $this->headScript()->appendFile($this->assetUrl('vendor/pannellum/videojs-pannellum-plugin.js', - 'PanoramaViewer')); - } - if ($title !== false && $title !== "") { - $title = sprintf('

%s

', $title); - } else { - $title = false; - } - ?> - - + + +
- - - - - -
+
@@ -64,8 +61,9 @@
- -
+