Attention
TYPO3 v8 has reached its end-of-life March 31st, 2020 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.
There is no further ELTS support. It is recommended that you upgrade your project and use a supported version of TYPO3.
type = 'none'¶
Introduction¶
This type will just show the value of the field in the backend. The field is not editable.
Format options can be set to format a given value. The field is often similar to a type = 'input'
field having readOnly=true
set.
Caution
With type = 'none'
the DataHandler cannot process the field since the type is unknown.
You may use type = 'input'
with readOnly=true
instead.
Properties renderType default¶
cols¶
- Datatype
integer
- Scope
Display
- Description
Set the width of the input field. Overrides size.
Value for the width of the
<input>
field. To set the input field to the full width of the form area, use the value 50. Default is 30.
fieldInformation¶
- Datatype
array
- Scope
Display
- Description
Show information between an element label and the main element input area. Configuration works identical to the "fieldWizard" property, no default configuration in the core exists (yet). In contrast to "fieldWizard", HTML returned by fieldInformation is limited, see FormEngine docs for more details.
format¶
- Datatype
string (keyword) + array
- Scope
Display
- Description
The value of a none-type fields is normally displayed as is. It is however possible to format it using this property. The following keywords are available, some having sub-properties. Sub-properties are called with the
format.
keyword (note the trailing dot), which in itself is an array.- date
Formats the value of the field as a date. The default formatting uses PHP's
date()
function andd-m-Y
as a format.Possible options are:
- strftime
(boolean) If true,
strftime()
is used insteaddate()
for formatting.- option
(string) Format string (i.e.
Y-m-d
or%x
, etc.).- appendAge
(boolean) If true, the age of the value is appended is appended to the formatted output.
- datetime
Formats the values using PHP's
date()
function andH:i d-m-Y
as a format.- time
Formats the values using PHP's
date()
function andH:i
as a format.- timesec
Formats the values using PHP's
date()
function andH:i:s
as a format.- year
Formats the values using PHP's
date()
function andY
as a format.- int
Formats the values as an integer using PHP's
sprintf()
in various bases. The default base is decimal (dec
). The base is defined as an option:- base
(string) Defines the base of the value. Possible bases are "dec", "hex", "HEX", "oct" and "bin".
- float
Formats the values as an real number using PHP's
sprintf()
and the%f
marker. The number of decimals is an option:- precision
(integer) Defines the number of decimals to use (maximum is 10, default is 2).
- number
Formats the values as a number using PHP's
sprintf()
. The format to use is an option:- option
(string) A format definition according to PHP's
sprintf()
function (see the reference).
- md5
Returns the md5 hash of the values.
- filesize
Formats the values as file size using
\TYPO3\CMS\Core\Utility\GeneralUtility::formatSize()
. One option exists:- appendByteSize
(boolean) If true, the original value is appended to the formatted string (between brackets).
- user
Calls a user-defined function to format the values. The only option is the reference to the function:
- userFunc
(string) Reference to the user-defined function. The function receives the field configuration and the field's value as parameters.
- Examples
'aField' => [ 'config' => [ 'type' => 'none', 'format' => 'date' 'format.' => [ 'strftime' => TRUE, 'option' => '%x' ], ], ],
'aField' => [ 'config' => [ 'type' => 'none', 'format' => 'float' 'format.' => [ 'precision' => 8 ], ], ],
pass_content¶
- Datatype
boolean
- Scope
Display
- Description
If set, then content from the field is directly outputted in the
<input>
section as value attribute. Otherwise, the content will be passed throughhtmlspecialchars()
.Be careful to set this flag since it allows HTML from the field to be outputted on the page, thereby creating the possibility of XSS security holes.
search¶
- Datatype
array
- Scope
Search
- Description
Defines additional search-related options for a given field.
- pidonly (boolean)
Searches in the column only if search happens on the single page, does not search the field if searching in the whole table.
- case (boolean)
Makes the search case-sensitive. This requires a proper database collation for the field, see your database documentation.
- andWhere (string)
Additional SQL WHERE statement without 'AND'. With this it is possible to place an additional condition on the field when it is searched
Example from "tt_content" bodytext:
'bodytext' => [ 'config' => [ 'search' => [ 'andWhere' => 'CType=\'text\' OR CType=\'textpic\'', ], ... ], ... ],
This means that the "bodytext" field of the "tt_content" table will be searched in only for elements of type Text and Text & Images. This helps making any search more relevant.