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

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