Json¶
type => 'json' // TCA
The Json
type is for a textarea which will be rendered as a json editor.
Settings¶
-
cols
¶ -
- Required
-
false
- Type
-
integer
- Default
-
30
Size for the input field. Min value is 10 and max value is 50.
-
rows
¶ -
- Required
-
false
- Type
-
integer
- Default
-
5
Amount of rows for the textarea. Min value is 1 and max value is 20.
-
required
¶ -
- Required
-
false
- Type
-
boolean
- Default
-
false
If set, the Json textarea needs to be filled.
-
readOnly
¶ -
- Required
-
false
- Type
-
boolean
- Default
-
false
If set, the Json textarea is read only.
-
enableCodeEditor
¶ -
- Required
-
false
- Type
-
boolean
- Default
-
true
In case
enableCodeEditor
is set totrue
, which is the default and the system extensiont3editor
is installed and active, the JSON value is rendered in the corresponding code editor. Otherwise it is rendered in a standard textarea HTML element.
Examples¶
Minimal¶
name: example/json
fields:
- identifier: json
type: Json
Copied!
Advanced / use case¶
name: example/json
fields:
- identifier: json
type: Json
required: true
readOnly: true
cols: 50
rows: 10
enableCodeEditor: false
placeholder: '[{"foo": "bar"}]'
Copied!