django-editorjs-fields icon indicating copy to clipboard operation
django-editorjs-fields copied to clipboard

Editorjs form field doesn't render in template

Open azaitsev opened this issue 2 years ago • 1 comments

I use following form:

class EditForm(forms.Form):
    title = forms.CharField(...)
    content = EditorJsWidget(config={'minHeight': 100})

and following template code for rendering:

{% for field in form %}
    <div class="mydiv">
        <label class="mylabel">{{ field.label }}</label>
        {{ field }}
    </div>
{% endfor %}

I see my title field but no content field. What I'm missing?

azaitsev avatar Dec 25 '22 22:12 azaitsev

{% load editorjs %}
{% for field in form %}
    <div class="mydiv">
        <label class="mylabel">{{ field.label }}</label>
        {{ field|editorjs }}
    </div>
{% endfor %}

dancaron avatar Mar 14 '23 02:03 dancaron