Hauer-Heinrich / hh_video_extender

TYPO3 extension. Extends sys_file_reference video/media. Added attributes to select in content element (eg textmedia)
0 stars 4 forks source link

Feature request preview_image in Backend Preview #1

Closed ses2013 closed 5 years ago

ses2013 commented 5 years ago

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

Teisi commented 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?

ses2013 commented 5 years ago

Hi, it is actually a hook of the textmedia in the bootstrap_package. Its tricky because of the relation of a relation, right?

ses2013 commented 5 years ago

And rendert in Fluid …

Teisi commented 5 years ago

did you do this like: https://blog.teamgeist-medien.de/2016/04/backendvorschau-fuer-eigene-inhaltselemente-mit-flexform.html

then i will check this...

ses2013 commented 5 years ago

Yes kind of …

Teisi commented 5 years ago

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?

ses2013 commented 5 years ago

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 …

Teisi commented 5 years ago

i would make this in fluid <f:image or <f:media ...

ses2013 commented 5 years ago

Not perfect but works. As there can be only 1 preview_image.

Video Thumb

Thanks for your help.

Teisi commented 5 years ago

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.