Skip to content
Snippets Groups Projects
Commit 1ec02711 authored by Michael Kessler's avatar Michael Kessler
Browse files

[TASK] Add media field to news meta data output

parent 582d4adf
No related branches found
No related tags found
1 merge request!40[TASK] Consider all filters when using the overview
This commit is part of merge request !40. Comments created here will be created in the context of that merge request.
......@@ -30,6 +30,7 @@ use RuntimeException;
use SGalinski\SgNews\Domain\Model\Category;
use SGalinski\SgNews\Domain\Model\News;
use SGalinski\SgNews\Service\ImageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
......@@ -95,6 +96,9 @@ abstract class AbstractController extends ActionController {
return $this->cachedSingleNews[$newsId];
}
$fileRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\FileRepository::class);
$fileObjects = $fileRepository->findByRelation('pages', 'media', $news->getUid());
$singleNewsImageData = $this->getDataForSingleViewImage($news, $category);
$teaserImageData = $this->getDataForTeaserImage($news, $category);
......@@ -114,7 +118,8 @@ abstract class AbstractController extends ActionController {
'news' => $news,
],
$singleNewsImageData,
$teaserImageData
$teaserImageData,
['media' => $fileObjects]
);
$this->cachedSingleNews[$newsId] = $newsRecord;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment