Change the backend-view of mask - TYPO3 - typo3

I try - in TYPO3 8.7.13 with the extension mask 3.1.0 - to build for example a CE with repeating records with fields for names - no problem.
But in the backend I can see only the first field. Is there any way to show both?
https://www.dropbox.com/s/rmsg5qfd51blhrf/mask1.png?dl=0

So there are preview templates they belong to the page view and not edit.
In edit mode you only see the label (this is given in the definition of IRRE in the TYPO3 core).
So you only can change the shown 'label' of the record. That means: using label_alt in the TCA (I recommend to use label_alt_force too):
'ctrl' => [
'label' => 'surname',
'label_alt' => 'givenname,surname',
'label_alt_force' => 1,
],

Related

TYPO3 EXT:cart_product: extend backend with one selection to do conditional theming in template

I'm looking for a way to extend the backend of the TYPO3 extension cart_products with one additional select field. I have already created some different ViewHelpers for the ProductBackendVariants and now need a way to choose the corresponding Viewhelper.
Best would be if there is a selection direct after the type select in the general product type. But I am not able to add some additional configuration fields to this tab.
Already added
'formtemplate' => [
'label' => 'ProductDetail Variant Form',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['Standard', 1],
['Matten', 2],
['Zaunpaket', 3],
],
'size' => 1,
'minitems' => 1,
'maxitems' => 1,
],
],
to the tx_cartproducts_domain_model_product_product.php but nothing appears in the backend.
I don't know that specific extension but some hints in general:
it seems that you have tried to modified the TCA directly in the extension (cart_products/Configuration/TCA/tx_cartproducts_domain_model_product_product.php). You should never change anything in a 3rd party extension (neither the TYPO3 core) because you loose the ability to update.
You need to create your own extension and add a file to Configuration/TCA/Overrides. Ideally you name the file exactly like the file you like to extend for easier understanding. See the documentation for details.
To add a new field to the TCA you not only need to define the name and type but you also need to create the database field. That's done in ext_tables.sql of your custom extension.
It's not sufficent to create the TCA config and SQL mentioned above you also need to tell, where the new field should be visible in the backend. That's done with the showitem setting. See documentation for details.
To ease the process of extending an existing TCA I can recommend the extension TCA Builder which makes it in many cases much easier to create the TCA code. See these examples how that's done. Nevertheless you need to create ext_tables.sql.
Last but not least: when you made changes to ext_tables.sql you need to run the database compare in the TYPO3 install tool.

TYPO3 TCA/Flexform Link Wizard: How to display page name in the backend?

I created a custom content element using a fluid template for the frontend and a flexform xml file for the backend. The element has a link input field that makes use of the link wizard as explained in this question:
How can i make a Link input Field in TCA
This works fine, but when I select a page from the page tree in the wizard, the input field displays the page ID (for example a "4"). If I use the same (?) wizard within content elements that vanilla TYPO3 provides (for example the "shortcut" page type), the backend shows the name of the page in the link input field, not the ID.
Is there an easy way to bring that functionality to my own element?
Remark: In my case, I don't use the PHP array writing style, but the XML one. So what would be 'config' => array(...) in the PHP array is ... in my XML Flexform.
This is standard behavior, see for an example Link field under the Header it also uses uid of the page, reason is simple: it allows to choose a page, but also external URL, email address or file reference - therefore it doesn't use page's title but its uid.
Second sample - shortcut to page definitely allows you to store only pages records, so it can render its title on the list - but doesn't allow you to mix different kinds of links.
If your ext will store always one type of link (ie. references to pages) you can use TCA field of type Group as showed in documentation
'storage_pid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_tca.xlf:storage_pid',
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => '1',
'maxitems' => '1',
'minitems' => '0',
'show_thumbs' => '1',
'wizards' => array(
'suggest' => array(
'type' => 'suggest'
)
)
)
),

Additional page property fields in TYPO3 CMS 6.2

What would be the recommended method to add custom page property fields in TYPO3 6.2?
In 4.5 I used TemplaVoila which had its own page module and made it easy to add data records on a page level.
There are several approaches:
The "vanilla" approach:
Create an extension (and with it the file ext_emconf.php) and then create a file ext_tables.sql in the extension root. In it you can put SQL-definitions for the new fields, by defining a CREATE TABLE statement for the pages table:
CREATE TABLE pages(
myNewField int(11) DEFAULT '',
);
This SQL-definition will be merged with existing definitions for the table page.
Then you need to configure the new field in the Table Configuration Array (TCA). You can usually find good examples in existing extensions, for example in realurl. There are two places where you can put these definitions, either in the file ext_tables.php (uncached), or into a php file in the folder Configuration/Tca/Overrides (cached).
This approach sounds like more work than it actually is.
Just use TemplaVoila. It is available for TYPO3 6.2, but its future is uncertain, AFAIK.
Use the fluidtypo3-Ecosystem of extensions, and especially the extension fluidpages. It does what you want, in a similar way to TemplaVoila, but with modern (= fluid-based) technologies.
if you need your own custom content elements, i recommend the extension "DCE" (Dynamic Content Elements).
DCE is really easy to customise and you can create Content elements in some minutes.
Also you can do it like Jost said. Do it with an own extension and put the TCA definition in your extTables.php
As example:
/www/htdocs/website/typo3conf/ext/custom_extension/ext_tables.php
$tmp_itm_extended_columns_pages = array(
'link_class' => array(
'exclude' => 0,
'label' => 'LLL:EXT:itm_extended/Resources/Private/Language/locallang_db.xlf:label.linkClass',
'config' => array(
'type' => 'select',
'items' => array(
array('Nichts', ''),
array('Zahnrad', 'icon-afford', 'EXT:custom_extension/Resources/Public/img/icons/icon_preferences_small.png'),
array('Fabrik', 'icon-factory', 'EXT:custom_extension/Resources/Public/img/icons/icon_factory_small.png'),
array('Computer', 'icon-software', 'EXT:custom_extension/Resources/Public/img/icons/icon_software_small.png'),
array('Person', 'icon-jobs', 'EXT:custom_extension/Resources/Public/img/icons/icon_person_small.png'),
array('Welt', 'icon-world', 'EXT:custom_extension/Resources/Public/img/icons/icon_world_small.png'),
array('Rohre', 'icon-pipe', 'EXT:custom_extension/Resources/Public/img/icons/icon_pipe_small.png'),
),
),
),
);
Then you have to add your new field to the ext_tables.sql
#
# Table structure for table 'pages'
#
CREATE TABLE pages (
link_class text
);

Typo3 override backend classes

It's been a few weeks I work on Typo3 6.2 and I want to know how to override Typo3 Core classes.
In my case, I have to edit the way select html objects are displayed (I want to add optgroup but Typo doesn't allow us to do it). So I edited the file "FormEngine.php" (typo3/sysext/backend/Classes/Form) and now it works.
But this isn't healthy for future upgrade.
Is there a way to override core classes like any other CMS would allow us to do ?
And I haven't been able to find something on the Internet and I think it could be useful.
Thank you :)
Zisiztypo
Instead of modifying source code of CMS you can just declare a field with a user type and then point your custom userFunc
From the ref:
'tx_examples_special' => array (
'exclude' => 0,
'label' => 'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:fe_users.tx_examples_special',
'config' => array (
'type' => 'user',
'size' => '30',
'userFunc' => 'Documentation\\Examples\\Userfuncs\\Tca->specialField',
'parameters' => array(
'color' => 'blue'
)
)
),
TIP: Using this approach, you can create ANY type of field you need, it can be i.e. Google Maps selector, set of fields with common dependencies filled by JS, etc, etc.

TYPO3 modify backend table

EDIT: TYPO3 version 4.7
there is table Create Website user with many tabs.
I am able to add new tab with my own data using:
$test = array(
'tx_promconf_send_email' => array(
'exclude' => 0,
'label' => 'HAHAHA',
'config' => array(
'type' => 'input'
,)));
t3lib_div::loadTCA('fe_users');
t3lib_extMgm::addTCAcolumns('fe_users',$test,1);
t3lib_extMgm::addToAllTCAtypes('fe_users','--div--;Documents;;;;1-1-1,tx_promconf_send_email');
But I am not able to put my input to already existing tabs. Also I was not able to find some explanation of this string 'fe_users','--div--;Documents;;;;1-1-1,tx_promconf_send_email'.
Is there an option how to modify existing tabs? Where can I found the name of the tab? I tried to use instead of --div-- name of the tab and it does not work.
This weird string is hardly documented. You can find the TCA Documentation here.
If you want to insert it to an existing tab, just do it by finding a field within the desired tab where you want to put your new field after or before.
For example:
t3lib_extMgm::addToAllTCAtypes('fe_users','tx_promconf_send_email', '', 'after:last_name');
Your field will now be displayed after the field "last_name", and so within the tab "Personal Data". You can also use "before:fieldname" to insert your field before a field.