[TYPO3-english] $TCA image filelist-module is not beening updated
Jacco van der Post
jacco at id-internetservices.com
Wed Jan 4 18:39:04 CET 2017
Hi Muriel,
Op 4-1-2017 om 15:58 schreef Muriel le Pair:
> Op 22-12-16 om 18:41 schreef Jacco van der Post:
>> Did you also check the model of tx_news?
>
> Yes, but I don't understand how the domain model is intertwined with the
> TCA.
>
> If I add a image in the BE of TYPO3, I would expect that this is taken
> care of by the TCA.
>
> So could somebody please give me a hint.
>
It ain't that hard ;-) Simple example; in the model
/**
* Thumbnail
*
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
protected $thumbnail;
/**
* Sets the Thumbnail
*
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $thumbnail
* @return void
*/
public function
setThumbnail(\TYPO3\CMS\Extbase\Domain\Model\FileReference $thumbnail)
{
$this->thumbnail = $thumbnail;
}
/**
* Returns the Thumbnail
*
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
public function getThumbnail()
{
return $this->thumbnail;
}
In the TCA of the record:
'thumbnail' => [
'label' => 'bla',
'config' =>
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'thumbnail',
array(
'appearance' => [
'createNewRelationLinkTitle' =>
'LLL:EXT:cms/locallang_ttc.xlf:media.addFileReference'
],
'maxitems' => 1,
),
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
],
And of course thumbnail should be in the interface and show item
definitions in the TCA.
In ext_tables.sql
thumbnail int(11) DEFAULT '0' NOT NULL,
will do. You need to update the database in the install tool after
editing the sql.
--
Kind Regards
Jacco van der Post
More information about the TYPO3-english
mailing list