Comments (1)
Sry i don't know how we can nest the dataProcessing thing correctly.
But you can try to use a custom viewhelper like this one below:
<?php
namespace HauerHeinrich\HhVideoExtender\ViewHelpers;
/***************************************************************
* Copyright notice
*
* (c) 2023 Christian Hackl
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
* Example
* <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
* xmlns:hhve="http://typo3.org/ns/HauerHeinrich/HhVideoExtender/ViewHelpers"
* data-namespace-typo3-fluid="true">
*
* <hhve:getPreviewImage as="previewImage" uid="154" />
*/
// use \TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use \TYPO3\CMS\Core\Utility\GeneralUtility;
class GetPreviewImageViewHelper extends AbstractViewHelper {
public function initializeArguments() {
$this->registerArgument('as', 'string', 'The name of the iteration variable', false, 'hhvideoextender');
$this->registerArgument('uid', 'int', 'Uid of the file / media which has the preview image attached.', false);
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
$templateVariableContainer = $renderingContext->getVariableProvider();
$uid = $arguments['uid'];
if(empty($uid) || !\is_numeric($uid)) {
return '';
}
$fileRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\FileRepository::class);
$fileObjects = $fileRepository->findByRelation('sys_file_reference', 'preview_image', $uid);
$output = '';
$templateVariableContainer->add($arguments['as'], $fileObjects);
$output .= $renderChildrenClosure();
return $output;
}
}
from hh_video_extender.
Related Issues (14)
- Feature request preview_image in Backend Preview HOT 10
- Several errors regarding FileReference class extended HOT 2
- composer install error HOT 2
- preview image for html5 video is not shown in frontend HOT 3
- [Feature] add subtitle support
- Can't update extension to 1.6 because of wrong version tag 1.51? HOT 2
- Dependency problem with TYPO3 10 HOT 2
- Is there any chance to use options (autoplay, controls) also in videos in news elements? HOT 2
- [Feature] add lazy loading option for videos
- [Question] TYPO3 11 support HOT 3
- TYPO3 12 compatibility HOT 2
- [Error] Undefined array key "hh_video_extender" HOT 1
- Missing poster images under TYPO3 v12 in the frontend HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hh_video_extender.