fixes attachments

This commit is contained in:
buttle 2021-05-31 11:11:20 +02:00
parent c736f6d3ff
commit f58b75700c
2 changed files with 7 additions and 6 deletions

View File

@ -1,21 +1,22 @@
# HeaderImage media for Omeka S
[HeaderImage] is a module for [Omeka S] arcHIVE theme that adds
an image to the page above the main menu.
[HeaderImage] is a helper module for [Omeka S] arcHIVE theme.
This image is added above the page's main menu.
## Install
```
cd ./modules
https://git.hangar.org/arcHIVE-tech/HeaderImage-omeka-module/archive/main.zip
https://git.hangar.org/arcHIVE-tech/arc-hive-HeaderImage-omeka-module/archive/main.zip
unzip main.zip
mv headerimage/ HeaderImage
mv arc-hive-headerimage-omeka-module HeaderImage
rm main.zip
```
## LISENCE
The module is released under the [MIT] License.
[HeaderImage]: https://git.hangar.org/arcHIVE-tech/arc-hive-HeaderImage-omeka-module
[arc-hive]: https://arc-hive.zone/
[Omeka S]: https://omeka.org/s
[MIT]: http://opensource.org/licenses/MIT

View File

@ -25,10 +25,10 @@ class HeaderImageViewHelper extends AbstractHelper
foreach ($page->blocks() as $block) {
if ($block->layout() === 'headerImage') {
$attachments = $block->attachments();
if ($$attachments) {
#if ($$attachments) {
$media = $attachments[0]->item()->media()[0];
return $media->primaryMedia()->thumbnailUrl('large');
}
#}
}
}
$site = $this->currentSite();