Fluidtypo3 Flux - save in table field - typo3

I'm trying to develop a frontend extensions with typo3 - fluidcontent. Is it possible to use the bodytext field of the tt_content table instead of the flexform field?
I would like to connect this text element with the tt_content.bodytext field.
<flux:field.text name="bodytext" label="Content" />

You can force Flux to save to the record itself, rather than the flexform field, by prefixing your field names with the name of the table that your form applies to. For example, since this implementation is for tt_content, you can name the field tt_content.bodytext and the value will be saved to that field instead.

Related

Remove a field from felogin extension's backend typo3

I need to remove certain fields like company, email etc from fe_users backend for my felogin extension. How it is possible with typo3 7.6?
What fields are available in the backend is determined what is written in the TCA. You might remove the fields from TCA, but that could cause problems if there is some code which assumes the fields exist.
So it's better to remove the fields only from the display list ($GLOBALS['TCA']['fe_users']['interface']['showRecordFieldList']).
use a file /Configuration/TCA/Overlay/fe_users.php to modify the global TCA.
use TSconfig to disable the fields. e.g. TCEFORM.fe_users.company.disabled = 1

How can I store flux form fields defined in TYPO3 page templates in database columns instead of flex fields?

Using flux to create custom content elements for TYPO3, fields that are defined in a flux:form are stored in a flex field as XML by default. By the solution Claus Due pointed out here (Fluidtypo3 Flux - save in table field), they can also be stored as individual columns in tt_content.
Now, when creating page templates and defining template parameters as flux input fields, could those be stored as indiviual columns in the "pages" table?
The obvious approach to do this in the same way as described for content elements, i.e.:
<flux:field.text name="pages.extrafield" label="Content" />
did not work. (I created the field "extrafield" in the pages table using my extension's ext_tables.sql)
The format you used is the correct one, but in order to get the field saved it first must be 1) allowed for the user who saves and 2) shown somewhere in the form; types passthrough and none should also work.
The last requirement is a safeguard added in a recent major version and is there to prevent doing things that normally would be prohibited by access settings or field availability.

TYPO3 tt_content structure: t3_origuid vs l18n_parent

I had to import a few posts from one TYPO3 site into another, which lead into some exploring of the DB structure. A specific question arose:
In localised content elements (tt_content entries with sys_language_uid = 1), the fields t3_origuid and l18n_parent are redundantly filled. l18n_parent is required for the backend localisation view to work.
Do they always have the same value? Or is there a use case where the values of the fields can differ?
l10n_parent / l18n_parent
The field configured in TCA as transOrigPointerField (usually l10n_parent or l18n_parent) is used for localization.
It always contains an id of the record in the default language (even if the record was translated from a record in non-default language), see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#transorigpointerfield
t3_origuid
The field configured in TCA as origUid (usually t3_origuid) is filled when record is copied or translated, and contains an id of the source record, see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#origuid
The fields will have the same value in some cases (e.g. translating a record from default language), but in other will have different value. E.g. when copying a record on the same page t3_origuid will be different than the l10n_parent.
To allow localization it is required to have transOrigPointerField (l10n_parent). Having origUid (t3_origuid) field is not hard requirement but a good practice as as some additional features may require it to work. Especially in newer versions of TYPO3. For example the Translation Wizard is currently using t3_origuid field.
l10n_source (since TYPO3 8.6)
Since TYPO3 8.6 a new database field l10n_source for tt_content table has been introduced together with a new TCA ctrl configuration translationSource. The translationSource field contains an uid of the record used as a translation source, no matter whether the record was translated in the free or connected mode.
see more in the documentation on l10n_source field
Those fields can have different values.
t3_origuid is a generic field pointing to a record from which the current one was derived in some way. For example by copying or localizing it. Here is some documentation for it.
The field l18n_parent is reserved for localization purposes.
Just as a addition to Jost's post:
To determine which field you should use check the value of:
$TCA['tx_yourtable']['ctrl']['transOrigPointerField']
ie. for tt_content it's:
$TCA['tt_content']['ctrl']['transOrigPointerField'] = 'l18n_parent';

Why can't magento accept `content` as a database field name?

I am creating a new module and in that module I add a form which has a field name content in the database.
Now when I add a wyswig editor in this form with the field name content in the database, the layout of the form in the backend changes completely as compared to default layout.
But when I changed the database field name from content to any other name lets say content_html or content_h etc etc., the layout of the form now appeared as a default form.
This happens only when I use wyswig editor, and without wyswig if I create simple form it accepts the values in the database under the content field name.
Why can't magento accept the content as a field name, using wyswig editor.
the problem is that magento sets the id of the element to same as the name and the id
content is already present:
<div class="main-col" id="content">
try to set a prefix to your for your form
$form->setHtmlIdPrefix('something_')
that should fix it

How to use a form text component multiple times through CRX DE in CQ5

I want to add a form text component multiple times in a page and give different id's to them in CQ5.
The default form text component doesn't provide option to specify an id, rather it generates one itself.
The id that is generated is the formId_elementName, where formId is the id of the form which is present in the form start component(defaults to "new_form") and the elementName is the value that is provided in the Element Name field of the form text component.
But, in case you would like to provide the authors, the ability to add their own id's to the form start component, then one possible way would be to override the default form text component.
Add an additional field to the dialog box of the form text component called id and use that value in the jsp as id for the input field. But be cautious when providing this functionality, as the authors may forget to update the id fields appropriately, there by resulting in many text fields having the same id.