Showing posts with label bilder. Show all posts
Showing posts with label bilder. 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']),
        );

Wednesday, June 11, 2014

Warum werden meine Bilder in der Extension tx_news nicht skaliert / gecroppt?


Wenn die TypoScript-Konfiguration in etwa so aussieht...

plugin.tx_news.settings.list.media.image.maxWidth = 100c
plugin.tx_news.settings.list.media.image.maxHeight = 100c

...dann koennte der Fehler evtl. darin bestehen dass "...c" (das c am Ende fuer croppen) nicht kombiniert werden kann - entweder Hoehe ODER Breite croppen, nicht beides.

Hier auch ein Forumsbeitrag zum Thema:
http://www.typo3.net/forum/thematik/zeige/thema/117141/