How to image upload in extension of typo3 6.2 version + Drag n drop image functionality in extension of typo3 6.2


 
Its very useful functionality for upload all images from system directory [sys_file]

Drag n drop image functionality also available in flexform of typo3 6.2

You can have to add following configuration in your image field.

Following code need to modify in your tca.php file.


$tempColumns = Array (

   "images"  => Array (
	
      "exclude"  => 0,
      "label"  => "Add your Media",
		
      "config"  => Array (
         "type"  => "inline",
         "internal_type"  => "file",
         "size"  => 10,
         "minitems"  => 1,
         "maxitems"  => 100,
			
         "appearance"  => Array(
            "headerThumbnail"  => Array(
               "field"  =>"uid_local",
                  "height"  =>"45c",
                  "width"  => "45"
               ),
               "enabledControls"  => Array(
                  "delete" => 1,
                  "dragdrop"  => 1,
                  "hide"  => 1,
                  "info"  => 1,
                  "localize"  => 1
               ),
               "useSortable"  => 1
         ),
			
         "behaviour"  => Array(
            "localizationMode"  => "select",
            "localizeChildrenAtParentLocalization"  => 1
         ),
			
         "foreign_field"  => "uid_foreign",
         "foreign_label"  => "uid_local",

         "foreign_match_fields"  => Array(
            "fieldname"  => "fal_filelist"
         ),
			
         "foreign_selector"  => "uid_local",
			
         "foreign_selector_fieldTcaOverride"  => Array(
            "config"  => Array(
               "appearance"  => Array(
                  "elementBrowserAllowed"  => "gif,jpg,jpeg,bmp",
                  "elementBrowserType"  => "file"
               )
            )
         ),
			
         "foreign_sortby"  => "sorting_foreign",
         "foreign_table"  => "sys_file_reference",
         "foreign_table_field"  => "tablenames",

         "show_thumbs" => 1,

      )
   ),
);

it will look like below image.

Flexform + image + typo3 6.2

Flexform + image + typo3 6.2

OR 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

How to set custom link while edit record from backend side of typo3 in custom extension


How to set custom link on tca file.

For set custom link on record then you have to modify your tca file

tca.php

"pdf_generator" => Array (		
   "exclude" => 1,		
   "label" => 'LLL:EXT:EXT_NAME/locallang_db.xml:tx_EXTNAME.download_pdf',		
   'config' => Array (
      'type' => 'user',
      'userFunc' => 'EXT:EXT_NAME/pi1/model/link.php:tx_examples_tca->specialField',
      'size' => '20',
   ),
),

Below is content of link.php file

<?php
class tx_examples_tca {
   function specialField($PA, $fObj)
   {
      return '<div><a href="../typo3conf/ext/EXT_NAME/pdf_generator.php?uid='.$PA['row']['uid'].'" style="position: relative; z-index: 9999;"><img src="../typo3conf/ext/EXT_NAME/pdficon.png" /></a></div>';
   }
}
?>

Note:
$PA[‘row’][‘uid’] : You will get current record unique id.

pdf_generator.php : You can write your all code in pdf_generator.php file.

After do modification in tca file. it will look like below image.

TCA Modification

TCA Modification

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

How to display table content in tab of typo3 extension


 
For display table content in tab of custom extension.

First you have to set “‘dividers2tabs’ => true” in exe_table.php file.

   'dividers2tabs' => true,

Dividers 2 tabs

Dividers 2 tabs


then after you have to modify tca.php file.

below code is original code of Tca file

'types' => array (
	'0' => array('showitem' => 'hidden;;1;;1-1-1, title;;;;2-2-2, images;;;;3-3-3, logo, small_image, address, place, types ')	
),

For set tab you have to add “–div–;Tab1,” before field name.

“Tab1” is stand for title of the tab. Below code is modified code

'types' => array (
	'0' => array('showitem' => '--div--;Tab1,hidden;;1;;1-1-1, title;;;;2-2-2, --div--;Tab2,images;;;;3-3-3, --div--;Tab3,logo, small_image,--div--;Tab4, address, place, --div--;Tab5,types ')
),
Tab in TCA

Tab in TCA

It will look like below image

TCA, Extension, table

TCA, Extension, table

I hope it will help you.. Good luck 🙂

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

How to add color picker in TCA of TYPO3


 
For add color picker. you have to add below script on yout tca file.

‘config’ => array (
   ‘type’ => ‘input’,
   ‘size’ => 10,
   ‘wizards’ => array(
       ‘_PADDING’ => 2,
       ‘color’ => array(
           ‘title’ => ‘Color:’,
           ‘type’ => ‘colorbox’,
           ‘dim’ => ’16×12',
           ‘tableStyle’ => ‘border:solid 1px black;’,
           ‘script’ => ‘wizard_colorpicker.php’,
           ‘JSopenParams’ => ‘height=300,width=250,status=0,menubar=0,scrollbars=1',
      ),
   ),
)

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