Suffix when copying TYPO3 content elements - typo3

I'm new to TYPO3 and I often copy content elements in the TYPO3 backend module. All copies are suffixed. They are also disabled/hidden after copying.
Is it possible to remove the automatic suffix of a copied content element?

You can configure this behaviour in TYPO3 for each table with Page-/UserTSConfig:
TCEMAIN {
table {
tt_content {
// remove suffix from copied record
disablePrependAtCopy = 1
// optionally you can set copied record visible with
disableHideAtCopy = 1
}
}
}
As mentioned already above, you can individually set this for each known and editable table within TYPO3.

Related

Indexing files linked in a flexform field with solrfal 3.1.0 in TYPO3 7.6

We have an old TYPO3 7.6 installation with a custom content element which uses flexform fields (saved in the pi_flexform field). It has an RTE field included in this. If you link to a file in that RTE field it is not indexed by solrfal (3.1.0). In a normal content element (with text in the bodytext field) it does work.
I've already tried adding the following to TypoScript without succes:
plugin.tx_solr {
index {
enableFileIndexing {
pageContext {
contentElementTypes {
fluidcontent_content = pi_flexform
}
}
}
}
}
Is there any way to add this flexform field to solrfal so linked files are indexed?
P.S. I know the versions are old and it should be updated.

TYPO3: How to use disablePrependAtCopy in combination with allowLanguageSynchronization?

My question refers to the default "assets"-TCA-field. For the assets-field allowLanguageSynchronization is set to 'true' and disablePrependAtCopy for sys_file_reference is active.
This configuration works as expected when the content element is translated for the first time. [Translate to XY] is not visible in the translated content element.
However, when I add another image to the content element for sys-lang 0 after the initial translation, [Translate to XY] is visible for sys-lang 1.
(Click image to enlarge)
How can I stop TYPO3 from adding [Translate to XY] to the metadata fields?
Configuration:
Version: TYPO3 9.5.5
'allowLanguageSynchronization' is set to true:
$GLOBALS['TCA']['tt_content']['columns']['assets']['config']['behaviour']['allowLanguageSynchronization'] = true;
I also disabledPrependAtCopy for assets:
TCEMAIN.table.sys_file_reference {
disablePrependAtCopy = 1
}
What I tried:
For sys-lang 0: Add image to a content element which uses the assets field (e.g. text-media).
Add metadata for image (e.g. title).
Translate content element to sys_lang 1 ([Translate to XY] is not visible as expected).
Go back to sys-lang 0: add a second image to content element and save the changes.
Switch to sys-lang 1: metadata of new file now contains [Translate to XY] -> How can I prevent that?
You need another TCEMAIN setting here.
Try the following code
TCEMAIN {
translateToMessage =
}
if this does not work, maybe you can disable it by this code
TCEMAIN {
translateToMessage >
}
The issue is still not fixed. https://forge.typo3.org/issues/87887 is connected to TYPO3 v9, however changes in v10 were made. Even those changes do not work..
However, I was able to walk around the problem by unset the l10n_mode of the fields alternative, description and title.
Default it is set to prefixLangTitle and exclude would remove the field in the translations completely.
Therefore, unset (or probably set it to empty or an invalid value) does not add the prefix.

Display tt_address records when inserted via "insert record" in TYPO3 8.7

I'm looking for a way to display tt_address elements that were inserted with the "insert record" content element in TYPO3 8.7 LTS. I'm aware of a way with css_styled_content but i can't figure out how to do it with fluid_styled_content. Somebody on Slack pointed me to the "RECORDS" TS-Object and maybe the DatabaseQueryProcessor. Sadly, i can't find good tutorials or documentations for my usecase. Any help would be greatly appreciated.
There are two approaches
Custom Content Element for tt_address
That's the right way.
You can check how TYPO3 itself does it within the "shortcut" content element, which is "Insert Records" from the editor point of view.
The hints are totally valid. Use FLUIDTEMPLATE to define the template to render and add the DatabaseQueryProcessor as documented here: https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html#dataprocessing
The processor can be found in the source code: https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/frontend/Classes/DataProcessing/DatabaseQueryProcessor.php#L22 with an example configuration inside the PHPDoc, which already uses tt_address.
Here a complete TypoScript example for the content element:
tt_content.custom_content =< lib.contentElement
tt_content.custom_content {
templateName = TtAddressRecords
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = tt_address
pidInList = 123
as = addresses
}
}
}
Using existing shortcut Content Element
If you are using the native shortcut content element already, this should work out of the box, with some configurations. It will resolve the selected records.
First of all you have to allow rendering of tt_address records through this element. Therefore add the following to the TypoScript Constants:
styles {
content {
shortcut {
tables := addToList(tt_address)
}
}
}
This will add tt_address to the existing tt_content table.
Next you need the rendering definition for tt_address records. This is done in TypoScript Setup. E.g. add the following TypoScript to the setup and adjust paths to your need:
tt_address < lib.contentElement
tt_address {
templateName = TtAddress
templateRootPaths {
10 = EXT:cdx_site/Resources/Private/Templates/Plugins/
}
}
The above example will use the Fluid Templates cdx_site/Resources/Private/Templates/Plugins/TtAddress.html to render each single tt_address record.
There should be no need to adjust the Shortcut.html template, as it will just display the rendered records.

How to rename subheader in TYPO3 CMS backend

How can I rename a TYPO3 CMS backend field for authors? i.e. the mentioned field for content-elements of csc_styled_content?
In general, overriding label names can by done with Page TSconfig in the backend. The following example modifies the label of the subheader field.
TCEFORM {
tt_content {
subheader.label = My new Label-Name
}
}
There are two way to configure that adjustment in TYPO3.
Type your configuration changes directly to the page settings » resources » TypoScript Configuration » Page TSConfig (see the screenshot below)
as an alternative you can store that configuration directly in the file system - either in your custom extension (e.g. at typo3conf/ext/my_extension/Configuration/TSconfig/labels.t3s) or with a similar name in the global file storage (e.g. fileadmin/templates/configuration/...)
That's basically it to provide custom labels for any database table in the TYPO3 backend. Find more aspects that can be adjusted in the accordant Page TSconfig documentation.
If you want to rename a field of an extension like tx_news you could do it this way.
TCEFORM {
tx_news_domain_model_news {
title.label = Your New Label
}
}
Now there are two ways to get this to work:
Put it in Page TSConfig of the page settings
OR
Load it with your extension from a file (e.g. EXT:my_extension/Configuration/pageTSConfig.typoscript). For that you have to import this script by EXT:my_extension/ext_localconf.php!
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:my_extrension/Configuration/pageTSConfig.typoscript">');

TYPO3 how duplicate content in severals page

I have a TYPO3 website.
I have 4 contents in my home page which I had created with TemplaVoila (flexible content).
I want to know if there is an easy way to duplicate these contents in all the others pages.
Yes, TemplaVoila allows you to reference ContentElements with special icon, which means that you insert it on some page and then you creates a references. If "first" CE changes, all references reflect it automatically.
Optionally, if all CE's are places in one TV's column you can use TV Content Slide extension by Bernhard Kraft.
Just map that content using typoscript using the below code and use it:
lib.leftcolumncontents = COA
lib.leftcolumncontents{
5 = RECORDS
5 {
tables = tt_content
source = 26 # content element id
}
15 = RECORDS
15 {
tables = tt_content
source = 36 # content element id
}
}