Skip to content

Instantly share code, notes, and snippets.

@cedricziel
Created June 13, 2013 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedricziel/5773139 to your computer and use it in GitHub Desktop.
Save cedricziel/5773139 to your computer and use it in GitHub Desktop.
Preview Images in TCA Forms
<?php
array(
'logo' => array(
'exclude' => 1,
'label' => 'LLL:EXT:cziel_worldcom_base/Resources/Private/Language/locallang_db.xlf:tx_czielworldcombase_domain_model_organisation.logo',
'config' => array(
'maxitems' => 1,
'type' => 'inline',
'foreign_table' => 'sys_file_reference',
'foreign_field' => 'uid_foreign',
'foreign_sortby' => 'sorting_foreign',
'foreign_table_field' => 'tablenames',
'foreign_match_fields' => array(
'fieldname' => 'logo'
),
'foreign_label' => 'uid_local',
'foreign_selector' => 'uid_local',
'foreign_selector_fieldTcaOverride' => array(
'config' => array(
'appearance' => array(
'elementBrowserType' => 'file',
'elementBrowserAllowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
)
)
),
'filter' => array(
array(
'userFunc' => 'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterInlineChildren',
'parameters' => array(
'allowedFileExtensions' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'disallowedFileExtensions' => ''
)
)
),
'show_thumbs' => 1,
'appearance' => array(
'collapseAll' => true,
'expandSingle' => true,
'newRecordLinkAddTitle' => 1,
'newRecordLinkPosition' => 'both',
'headerThumbnail' => array(
'field' => 'uid_local',
'height' => 64,
'width' => 64
)
)
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment