thawne
thawne

Reputation: 33

how to set the placeholder property of django-ckeditor

while using django-ckeditor for my website, i want to set the 'placeholder' property for the editor

I've tried to work directly in settings.py like this :

CKEDITOR_CONFIGS = {
    'default': {
        ...
        'extraPlugins': ','.join(['placeholder']),
        'placeholder': 'blabla'
    },
}

and i tried this in my_app/forms.py:

        widgets = {
            'body': forms.Textarea(attrs={'placeholder': 'blabla'})
        }

but it didn't work! what should i do?

Upvotes: 2

Views: 492

Answers (1)

CyberFlex
CyberFlex

Reputation: 53

Use editorplaceholder key

CKEDITOR_CONFIGS = {
    'default': {
        ...
        'extraPlugins': ','.join(['placeholder']),
        'editorplaceholder': 'blabla'
    },
}

Upvotes: 1

Related Questions