Feature: #92462 - Add optional "defaultValues" argument to newRecord ViewHelpers
See forge#92462
Description
A new optional argument default
is added to the be:
and
be:
ViewHelpers. The new argument can contain default values for
fields of the new record. FormEngine automatically fills the given default values
into the corresponding fields.
The syntax is: {table
.
Please note that the given default values are added to the url as GET
parameters
and therefore override default values defined in FormDataProviders or TSconfig.
Impact
It is now possible to assign default values to fields of new records using the
default
argument in the be:
and be:
ViewHelpers.
Example
Link to create a new tt_
record on page 17 with a default value for field header
:
<be:link.newRecord table="tt_content" pid="17" defaultValues="{tt_content: {header: 'value'}}" returnUrl="foo/bar">
New record
</be:link.newRecord>
Output:
<a href="/typo3/index.php?route=/record/edit&edit[tt_content][17]=new&returnUrl=foo/bar&defVals[tt_content][header]=value">
New record
</a>