Skip to content

Commit

Permalink
Merge pull request #86 from khalwat/feature/v3-code-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
jalendport authored Dec 2, 2022
2 parents 195cb05 + 93e86ae commit 0e095c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"require": {
"craftcms/cms": "^3.2.0",
"nystudio107/craft-twigfield": "^1.0.0"
"nystudio107/craft-code-editor": "^1.0.0"
},
"autoload": {
"psr-4": {
Expand Down
11 changes: 8 additions & 3 deletions src/templates/_components/fields/_settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@
#}

{% import "_includes/forms" as forms %}
{% import "twigfield/twigfield" as twigfield %}
{% import "codeeditor/codeEditor" as codeEditor %}

{{ twigfield.textareaField( {
{% set monacoOptions = {
} %}
{% set codeEditorOptions = {
wrapperClass:"monaco-editor-background-frame"
} %}
{{ codeEditor.textareaField( {
label: "Twig code to parse"|t,
instructions: "Enter the twig code that you want to parse after the entry has been saved.\nIf the column type is set to Date (datetime), the parsed Twig should output a date formatted as `Y-m-d H:i:s`."|t,
id: 'fieldTwig',
name: 'fieldTwig',
value: field['fieldTwig'],
class: 'code',
rows: 10,
}, "Twigfield", "monaco-editor-background-frame") }}
}, "CodeField", monacoOptions, codeEditorOptions) }}

{% set columnType %}
{{ forms.select({
Expand Down

0 comments on commit 0e095c1

Please sign in to comment.