trilbymedia / grav-plugin-flex-directory

Flexible plugin that allows CRUD functionality on complex data types
MIT License
39 stars 7 forks source link

Custom form with textarea editor field #18

Closed multiplaie closed 6 years ago

multiplaie commented 6 years ago

we can't display correctly an textarea editot field to the flex-directory form.

#entries.yaml
 title: My title
form:
  validation: loose
  fields:
    decription:
        type: editor
        label: Description
        autofocus: true
        codemirror:
            mode: 'yaml'
            indentUnit: 4
            autofocus: true
            indentWithTabs: false
            lineNumbers: true
            styleActiveLine: true
            gutters: ['CodeMirror-lint-markers']
            lint: true

...

when we do, the textarea be something weird

capture du 2017-10-25 16-18-42

we found how to work around the problem by displaying a textarea field and read the text in markdown in the .twig page

#entries.yaml

...
decription:
        type: textarea
        label: Description
        validate:
          type: textarea

...

#target_page.html.twig

...
<div class="entry-content">
    {{data.decription|markdown}}
</div>

...

But i think it will be better if we found a way to display a textarea editor field

newmedicine commented 6 years ago

Hi @multiplaie, did you ever resolve this? The "editor" field type is pretty vital for me as for you Nick

newmedicine commented 6 years ago

Think I've fixed this with https://github.com/newmedicine/grav-plugin-flex-directory/pull/1 but don't know how to get this "adopted"

newmedicine commented 6 years ago

Pull request https://github.com/trilbymedia/grav-plugin-flex-directory/pull/24 submitted, let's see what happens.

mahagr commented 6 years ago

@newmedicine Merged. :) I'm assuming that the issue can be closed now.