Im writing my own extension. Now i like my textarea to be edited i RTE. I tried some configurations from web and i cannot make it work..
Part of my TCA:
'tasks' => array(
'exclude' => 0,
'label' => 'LLL:EXT:jobs/Resources/Private/Language/locallang_db.xlf:tx_jobs_domain_model_joboffer.tasks',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15
),
'defaultExtras' => 'richtext[]'
),
Like here: http://docs.typo3.org/typo3cms/CoreApiReference/Rte/InTheBackend/Index.html
NOT WORKING :(
I also tried similar to this: http://typo3blogger.de/der-t3editor-im-tca/ and also cannot make it work. In cms i always see simple textarea. Any ideas how to plug it in?
my TCA script:
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, add_date, reference_number, position, link_url, localization, title, requirements;;;richtext:rte_transform[mode=ts_links], tasks;;;richtext::rte_transform[flag=rte_disabled|mode=ts_css], offer;;;richtext:rte_transform[mode=ts_links], category, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'),
),
and columns:
'tasks' => array(
'exclude' => 0,
'label' => 'LLL:EXT:jobs/Resources/Private/Language/locallang_db.xlf:tx_jobs_domain_model_joboffer.tasks',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15
),
'defaultExtras' => 'richtext[]'
),
If you field is called tasks, you need in your *showitem** section this code:
tasks;;;richtext::rte_transform[flag=rte_disabled|mode=ts_css],
see e.g. https://github.com/TYPO3-extensions/news/blob/master/Configuration/TCA/tx_news_domain_model_news.php#L612
Related
I need a tca field with a link to huge files (100-900 MB). I used this TCA:
'config' => [
'type' => 'input',
'renderType' => 'inputLink',
'fieldControl' => [
'linkPopup' => [
'options' => [
'blindLinkOptions' => 'mail,page,spec,url,folder',
'blindLinkFields' => 'class,params,target,title',
],
],
],
]
It works but when I save the data TYPO3 seems to copy the file and I get the error message that the limit of 50 MB is exceeded. But I need only a simple link to the file.
In version 7 it worked with this code:
'config' => array (
'type' => 'input',
'size' => '100',
'max' => '255',
'eval' => 'trim',
'wizards' => array(
'_PADDING' => 2,
'link' => array(
'type' => 'popup',
'title' => 'LLL:EXT:cms/locallang_ttc.xml:header_link_formlabel',
'icon' => 'link_popup.gif',
'module' => array(
'name' => 'wizard_element_browser',
'urlParameters' => array(
'mode' => 'wizard',
'act' => 'file'
)
),
'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
)
),
)
but it doesn't work anymore in TYPO3 8.
How can i fix the problem?
Correction:
I am sorry but I was wrong. The whole question is wrong: The above configuration works as expected, it does not copy the file, it only links to the file. I made another error which leads to a misunderstanding of my real problem.
Sorry for the noise ...
In order to close the topic I will mark the answer as correct. In some way it was because it gave me a good hint.
Take a look to FAL. Here the files are only referenced to the orgin file.
'image' => array(
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', array(
'appearance' => array(
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
),
// custom configuration for displaying fields in the overlay/reference table
// to use the imageoverlayPalette instead of the basicoverlayPalette
'foreign_types' => array(
...
)
), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
),
Hi guys I am struggling with TYPO3 and I would like to do a search filter on my select.
I have this TCA for my select. I added there also this 'enableMultiSelectFilterTextfield' => true, but nothing changes. Is there a way how to achieve this?
$fields = array(
'my_plugin' => array(
'label' => 'my Fields',
'exclude' => 1,
'config' => array(
'type' => 'select',
'enableMultiSelectFilterTextfield' => true,
'maxitems' => 99999,
'itemsProcFunc' => 'tx_get_list->getList',
'items' => array(
),
),
)
);
At my standard content elements text & media the fullscreen mode for RTE (htmlarea, Rich-Text-Editor) is working fine.
But - I've wrote an extension (via extension builder) and if I try to use the RTE in fullscreen, I've got the following error:
Module wizard_rich_text_editor is not configured
Here's my TCA, where's my error? The 'TYPO3-RTE' is working fine, so there must be an error in my following code. What do you think?
'description' => array(
'exclude' => 1,
'label' => 'LLL:EXT:xyz/Resources/Private/Language/locallang_db.xlf:tx_xyz_domain_model_product.description',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
'wizards' => array(
'RTE' => array(
'icon' => 'wizard_rte2.gif',
'notNewRecords'=> 1,
'RTEonly' => 1,
'module' => array(
'name' => 'wizard_rich_text_editor',
'urlParameters' => array(
'mode' => 'wizard',
'act' => 'wizard_rte.php'
)
),
'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.RTE',
'type' => 'script'
)
)
),
),
Does anyone know the problem? Thanks for your help.
Regards,
Stefan
A working example for TYPO3 7.x and 8 is
'bodytext' => [
'exclude' => 0,
'l10n_mode' => 'noCopy',
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext_formlabel',
'config' => [
'type' => 'text',
'cols' => 30,
'rows' => 5,
'softref' => 'rtehtmlarea_images,typolink_tag,images,email[subst],url',
'wizards' => [
'_PADDING' => 2,
'RTE' => [
'notNewRecords' => 1,
'RTEonly' => 1,
'type' => 'script',
'title' => 'Full screen Rich Text Editing',
'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif',
'module' => [
'name' => 'wizard_rte',
],
],
],
]
],
The name should be wizard_rte.
I have set up a small extension with the extension builder containing a few fields, one of which is the internal_type: 'file_reference'.
'dokument' => array(
'exclude' => 0,
'label' => 'LLL:EXT:publikationen/Resources/Private/Language/locallang_db.xlf:tx_publikationen_domain_model_publikation.dokument',
'config' => array(
'type' => 'group',
'internal_type' => 'file_reference',
//'uploadfolder' => 'uploads/tx_publikationen',
'allowed' => '*',
'disallowed' => 'php',
'size' => 5,
),
),
The field appears in the backend, but the Element browser is unable to show any files to select:
If I remove the "bparams" parameter from the URL shown above, it is able to see the files that are there.
How can this be brought to work?
FAL fields require complicated configuration. To make that easier, there is a function returning the TCA config for such a field.
Its usage for a field that allows only one file looks like this:
'dokument' => array(
'label' => 'LLL:EXT:publikationen/Resources/Private/Language/locallang_db.xlf:tx_publikationen_domain_model_publikation.dokument',
'exclude' => 0,
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'dokument',
array(
'maxitems' => 1,
'minitems' => 1,
'appearance' => array(
'enabledControls' => array(
'dragdrop' => FALSE,
'localize' => FALSE,
),
),
)
),
),
A look into the source code of that function makes me not want to do that manually.
I have made in backend a TCA form, what will change depending of the value in select field "type":
This select field contains basically the options:
rte text
url
picture
I can make the system working so, that when "rte text" is chosen, it shows specified fields for "rte text", when url is chosen it shows specified fields for "url" etc..
In my case the content is always saved in database in field "content" and the selected type is saved in field "type".
My problem is that I have not found a way to change the "content" form field / configuration, depending on the selected type.
For example when I choose "rte text" it should use for the content field this kind of configuration (rich text editor):
'content' => array (
'exclude' => 0,
'label' => 'Content',
'config' => array (
'type' => 'text',
'cols' => '30',
'rows' => '5',
'wizards' => array(
'_PADDING' => 2,
'RTE' => array(
'notNewRecords' => 1,
'RTEonly' => 1,
'type' => 'script',
'title' => 'Full screen Rich Text Editing|Formatteret redigering i hele vinduet',
'icon' => 'wizard_rte2.gif',
'script' => 'wizard_rte.php',
),
),
)
),
and when I choose "picture" it should use for the content field this kind of configuration (file uploader):
'content' => array (
'exclude' => 0,
'label' => 'Content',
'config' => array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => '',
'disallowed' => 'php,php3',
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/tx_uploadshere',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
Is there a way to change that configuration depending of the value in the selectbox. I have tried to put two contents in an array but haven't got it working on that way.
Unfortunately you cannot change the properties of a single field via type.
You can however influence what's being displayed. So you can configure two independent fields and switch the display:
ext_tables.php:
$TCA['tx_yourextension_yourtable'] = array(
'ctrl' => array(
//...
'type'=>'type',
//...
),
);
TCA.php:
$TCA['tx_yourextension_yourtable'] = array(
'ctrl' => $TCA['tx_yourextension_yourtable']['ctrl'],
'types' => array(
0 => array('showitem' => 'content_rte'),
1 => array('showitem' => 'content_image'),
),
'columns' => array(
'content_rte' => array(
'exclude' => 0,
'label' => 'Content',
'config' => array(
'type' => 'text',
'cols' => '30',
'rows' => '5',
'wizards' => array(
'_PADDING' => 2,
'RTE' => array(
'notNewRecords' => 1,
'RTEonly' => 1,
'type' => 'script',
'title' => 'Full screen Rich Text Editing|Formatteret redigering i hele vinduet',
'icon' => 'wizard_rte2.gif',
'script' => 'wizard_rte.php',
),
),
)
),
'content_upload' => array(
'exclude' => 0,
'label' => 'Content',
'config' => array(
'type' => 'group',
'internal_type' => 'file',
'allowed' => '',
'disallowed' => 'php,php3',
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/tx_uploadshere',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
),
// ...
);
(Note: I've removed system fields like hidden, sys_language_uid etc. for simplicity's sake)