How to image store in tt_content or sys_file_reference table + TYPO3.


 
If you want to use images field in custom plugin then you have to use following code.

This image will take it from sys_file table. this will be store in tt_content field.

It’s create relations directly to the “sys_file” table by not using MM information.

$tempColumns = Array (
    "images" => Array (
        "exclude" => 0,
        "label" => "Images",
        'config' => array(
            'type' => 'group',
            'internal_type' => 'db',
            'allowed' => 'sys_file',

            'prepend_tname' => TRUE,
            'appearance' => array(
                'elementBrowserAllowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
                'elementBrowserType' => 'file'
            ),

            'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
            'show_thumbs' => '1',
            'size' => '5',
            'maxitems' => '200',
            'minitems' => '0',
            'autoSizeMax' => 40,
        ),
    ),
);

If you want to store it in sys_file_reference table then you have to use following two line in configuration.

It’s create relations using MM information [ sys_file_reference ].

'MM' => 'sys_file_reference',
'MM_match_fields' => array(
    'fieldname' => 'image_fal_group'
),

Since “db” references can be stored for multiple tables the rule is that uid numbers without a table name prefixed are implicitly from the first table in the allowed table list! Thus the list “32,141,72,10” is implicitly understood as “sys_file_32,sys_file_141,sys_file_72,sys_file_10”. That would be equally good for storage,

If you want to add image as tt_content field in your custom plugin then please Click Here

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s