Last active
November 16, 2015 12:46
-
-
Save chriwo/764ae0c0f3b0ce118b9b to your computer and use it in GitHub Desktop.
Create a new FAL element in TCA. To use it, change the current field name "new_fal_image" and the table name "YOUR TABLE NAME", so that TYPO3 find your image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE your_table_name ( | |
new_fal_image int(11) DEFAULT '0' NOT NULL, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'columns' => array( | |
'new_fal_image' => array( | |
'exclude' => 1, | |
'l10n_mode' => 'mergeIfNotBlank', | |
'label' => 'FAL image label', | |
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( | |
'media', | |
array( | |
'appearance' => array( | |
'showPossibleLocalizationRecords' => 1, | |
'showRemovedLocalizationRecords' => 1, | |
'showAllLocalizationLink' => 1, | |
'showSynchronizationLink' => 1, | |
), | |
'foreign_match_fields' => array( | |
'fieldname' => 'new_fal_image', | |
'tablenames' => 'YOUR TABLE NAME', | |
'table_local' => 'sys_file', | |
), | |
// custom configuration for displaying fields in the overlay/reference table | |
// to use the newsPalette and imageoverlayPalette instead of the basicoverlayPalette | |
'foreign_types' => array( | |
'0' => array( | |
'showitem' => ' | |
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imagePalette, | |
--palette--;;imageoverlayPalette, | |
--palette--;;filePalette', | |
), | |
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array( | |
'showitem' => ' | |
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imagePalette, | |
--palette--;;imageoverlayPalette, | |
--palette--;;filePalette', | |
), | |
), | |
), | |
'jpg,jpeg,gif,png' | |
), | |
), | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment