Closed ses2013 closed 5 years ago
How did you change the preview in the backend (hook or mod. or ...)? From your own custom content element or from an existing one, for example textmedia?
Hi, it is actually a hook of the textmedia in the bootstrap_package. Its tricky because of the relation of a relation, right?
And rendert in Fluid …
did you do this like: https://blog.teamgeist-medien.de/2016/04/backendvorschau-fuer-eigene-inhaltselemente-mit-flexform.html
then i will check this...
Yes kind of …
in the linked method (hook) you can add something like:
$fluidTmpl->assign('row', $row);
$fileRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\FileRepository::class);
$assets = $fileRepository->findByRelation('tt_content', 'assets', $row['uid']);
foreach ($assets as $key => $value) {
$assets['prevImage'] = $fileRepository->findByRelation('sys_file_reference', 'preview_image', $value->getUid());
}
DebuggerUtility::var_dump($assets);
Did this work for you?
OK suuper: I get the path to the file now. How would I make a Thumbnail out of it either in den Hook or in Fluid ? Thx this should be the last step …
i would make this in fluid <f:image or <f:media ...
Not perfect but works. As there can be only 1 preview_image.
Thanks for your help.
you can have more than one preview image if you like - you have to overwrite the TCA definition (Configuration/TCA/Overrides/.... in your own extension / theme. And you should still adapt / optimize the above-mentioned code. For example with an "IF" if ever a preview picture exists - and the preview picture also assign to the correct "main" picture/video.
Hi there, thx for the extender. Is there a way to show the preview_image in the Backend Preview ? I can't resolve the Relations to it properly. Thanks for any hint. Stefan