diff --git a/src/Site/BlockLayout/HeaderImage.php b/src/Site/BlockLayout/HeaderImage.php
index d0a3ad4..2542a00 100644
--- a/src/Site/BlockLayout/HeaderImage.php
+++ b/src/Site/BlockLayout/HeaderImage.php
@@ -45,14 +45,7 @@ class HeaderImage extends AbstractBlockLayout
$form = $this->formElementManager->get(HeaderImageBlockForm::class);
$form->prepare();
- $html = '';
- $html .= $view->blockAttachmentsForm($block);
- //$html .= '';
- //$html .= $view->translate('Options'). '
';
- //$html .= '
';
- //$html .= $view->formCollection($form);
- //$html .= '
';
- return $html;
+ return $view->blockAttachmentsForm($block);
}
public function render(PhpRenderer $view, SitePageBlockRepresentation $block)
diff --git a/src/View/Helper/HeaderImageViewHelper.php b/src/View/Helper/HeaderImageViewHelper.php
index 6666180..cea6509 100644
--- a/src/View/Helper/HeaderImageViewHelper.php
+++ b/src/View/Helper/HeaderImageViewHelper.php
@@ -25,8 +25,10 @@ class HeaderImageViewHelper extends AbstractHelper
foreach ($page->blocks() as $block) {
if ($block->layout() === 'headerImage') {
$attachments = $block->attachments();
- $media = $attachments[0]->item()->media()[0];
- return $media->primaryMedia()->thumbnailUrl('large');
+ if ($$attachments) {
+ $media = $attachments[0]->item()->media()[0];
+ return $media->primaryMedia()->thumbnailUrl('large');
+ }
}
}
$site = $this->currentSite();