Last active
August 29, 2015 14:14
-
-
Save a-r-m-i-n/c91d5a0e313a44217c9b to your computer and use it in GitHub Desktop.
UserFields for TYPO3 (TCA)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class tx_ext_myCustomField { | |
| /** | |
| * @var array Field parameters | |
| */ | |
| protected $parameter = array(); | |
| /** | |
| * @param $parameter | |
| * @return string | |
| */ | |
| function getMyCustomField($parameter) { | |
| $isCool = $parameter['fieldConf']['config']['parameters']['isCool']; | |
| return '<div>The HTML of your field</div>'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if (!defined('TYPO3_MODE')) { | |
| die ('Access denied.'); | |
| } | |
| if (TYPO3_MODE === 'BE') { | |
| require_once(t3lib_extMgm::extPath($_EXTKEY).'Classes/UserFunction/class.tx_ext_myCustomField.php'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if (!defined ('TYPO3_MODE')) { | |
| die ('Access denied.'); | |
| } | |
| $TCA['tx_ext_domain_model_whatever'] = array( | |
| 'ctrl' => $TCA['tx_ext_domain_model_whatever']['ctrl'], | |
| 'interface' => array( | |
| 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden', | |
| ), | |
| 'types' => array( | |
| '1' => array('showitem' => 'hidden;;1,myCoolNewOwnField'), | |
| ), | |
| 'palettes' => array( | |
| '1' => array('showitem' => ''), | |
| ), | |
| 'columns' => array( | |
| 'template_content' => array( | |
| 'exclude' => 0, | |
| 'label' => 'My cool new own field', | |
| 'config' => array ( | |
| 'type' => 'user', | |
| 'userFunc' => 'EXT:ext/Classes/UserFunction/class.tx_ext_myCustomField.php:tx_ext_myCustomField->getMyCustomField', | |
| 'parameters' => array( | |
| 'isCool' => TRUE | |
| ), | |
| ), | |
| ), | |
| ), | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment