blog.exotec

TYPO3 . XHTML/CSS . JavaScript/AJAX . iPhone/iOS

Mit Extbase Pages Media Resources auslesen

Im Controller oder Repository:

public function findFileFromPageMedia( $pid ){
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$fileRepository = $objectManager->get('TYPO3\CMS\Core\Resource\FileRepository');
$fileObjects = $fileRepository->findByRelation('pages', 'media', $pid);
// gibt Image Object Information
$files = array();
foreach ($fileObjects as $key => $value) {
$files[$key]['reference'] = $value->getReferenceProperties();
$files[$key]['original'] = $value->getOriginalFile()->getProperties();
}
return $files;
}

Fluid Template:

<f :image src="{result.image.0.reference.uid}" alt="" width="70c" height="70c" treatIdAsReference="1" />

Kommentar schreiben:


86,393 Spam-Kommentare
blockiert von
Akismet