Hilft Dir bei Deiner Arbeit. Zeigt Dir das was nicht im Handbuch steht. Loest unloesbare Probleme. Das Schweizer Taschenmesser und die milchgebende Eier-Sau im Wollpelz in Sachen TYPO3.
Showing posts with label reference. Show all posts
Showing posts with label reference. Show all posts
Wednesday, June 24, 2015
Wie erhalte ich eine FAL Datei Referenz z.b. zur Verwendung mit TypoScript IMAGE cObject?
$relationHandler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\RelationHandler');
$configuration = $GLOBALS['TCA']['tt_content']['columns']['image']['config'];
$relationHandler->start($imagedata['image'], $configuration['foreign_table'], $configuration['MM'], $imagedata['uid'], 'tt_content', $configuration);
$relationHandler->processDeletePlaceholder();
$referenceUids = $relationHandler->tableArray[$configuration['foreign_table']];
foreach ($referenceUids as $referenceUid) {
try {
$fileReference = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileReferenceObject($referenceUid, array(), ($wsid === 0));
//$origFile = $fileReference->getOriginalFile();
$filename = $fileReference->getName();
// write back to our $imagedata element... (for compatibility)
$imagedata['image'] = $filename;
// ...and store fileReference identifier for later use:
$imagedata['fileref_uid'] = $fileReference->getUid();
} catch (\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $e) {
/* just catch exception, because we can't do anything about it here */
}
}
$confIMG = array(
'file' => isset($imagedata['fileref_uid']) ? $imagedata['fileref_uid'] : 'uploads/pics/'.$imagedata['image'],
'file.' => array (
'width' => $width,
'treatIdAsReference' => isset($imagedata['fileref_uid']) ? 1 : 0,
),
'params' => 'align="left" style="margin:0 10px 5px 0;"',
'titleText' => trim($imagedata['tx_team_position'].' '.$imagedata['header']),
);
Labels:
6.x,
bilder,
fal,
fal migration,
field image,
file,
image,
IMG_RESOURCE,
media,
reference,
typo3 6.2,
typoscript,
update,
upgrade
Subscribe to:
Posts (Atom)