-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can’t configure plug-ins #27
Comments
problem was due to editorjs-change-case I also found a bug that didn't take default tools. Will fix it in the next version I fixed the configuration with comments (config in field): from django_editorjs_fields import EditorJsJSONField
from django.urls import reverse_lazy
class Post(models.Model):
body_custom = EditorJsJSONField(
plugins=[
'@editorjs/paragraph',
'@editorjs/image',
'@editorjs/header',
'@editorjs/list',
'@editorjs/checklist',
'@editorjs/quote',
'@editorjs/raw',
'@editorjs/code',
'@editorjs/inline-code',
'@editorjs/embed',
'@editorjs/delimiter',
'@editorjs/warning',
'@editorjs/link',
'@editorjs/marker',
# '@editorjs/table', # duplicate
'editorjs-alert',
'editorjs-table',
# 'editorjs-change-case', # it looks like a plugin bug
'@editorjs/personality',
'editorjs-drag-drop',
'editorjs-undo',
# you need to write to the author of the plugin so that he replaces <button> tag with <div> or adds type="button" for alignment buttons
# because the buttons send the form in the admin panel
'editorjs-text-alignment-blocktune'
],
tools={
'Image': {
'class': 'ImageTool',
'inlineToolbar': True,
"config": {
"endpoints": {
"byFile": reverse_lazy('editorjs_image_upload'),
"byUrl": reverse_lazy('editorjs_image_by_url')
}
},
},
'Header': {
'class': 'Header',
'inlineToolbar': True,
'config': {
'placeholder': 'Enter a header',
'levels': [2, 3, 4],
'defaultLevel': 2,
'tunes': ['BlockTune'],
},
},
'Checklist': {'class': 'Checklist', 'inlineToolbar': True},
'List': {'class': 'List', 'inlineToolbar': True},
'Quote': {'class': 'Quote', 'inlineToolbar': True},
'Raw': {'class': 'RawTool'},
'Code': {'class': 'CodeTool'},
'InlineCode': {'class': 'InlineCode'},
'Embed': {'class': 'Embed'},
'Delimiter': {'class': 'Delimiter'},
'Warning': {'class': 'Warning', 'inlineToolbar': True},
'LinkTool': {
'class': 'LinkTool',
'config': {
'endpoint': reverse_lazy('editorjs_linktool'),
}
},
'Marker': {'class': 'Marker', 'inlineToolbar': True},
# 'Table': {'class': 'Table', 'inlineToolbar': True}, # duplicate
'alert': {
'class': 'Alert',
'inlineToolbar': True,
'shortcut': 'CMD+SHIFT+A',
'config': {
'defaultType': 'primary',
'messagePlaceholder': 'Enter something',
},
},
'table': {
'class': 'Table',
},
# 'anchorTune': { # plugin is not included
# 'class': 'AnchorBlockTune'
# },
# 'changeCase': { # bug
# 'class': 'ChangeCase',
# 'config': {
# 'showLocaleOption': True,
# 'locale': 'tr'
# }
# },
'personality': {
'class': 'Personality',
'config': {
'endpoint': '/upload/image/'
}
},
# 'carousel': { # plugin is not included
# 'class': 'Carousel',
# 'config': {
# 'endpoints': {
# 'byFile': '/upload/image/',
# }
# }
# },
'BlockTune': {
'class': 'AlignmentBlockTune',
'config': {
'default': "right",
'blocks': {
'header': 'center',
'list': 'right'
}
},
},
'paragraph': {
'class': 'Paragraph',
'inlineToolbar': False,
'tunes': ['BlockTune'],
},
},
null=True,
blank=True,
) |
upgrade to 0.2.6 |
Thank you for such a quick reply! You’re really saving us from failing deadlines! Later today will try the config. :) |
Everything is great! Thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm trying to add plugins. However, Editor js doesn't show new tools and plugins, only the default ones. I checked network (cdn) and it does download them.
Here is my settings.py for Editor.js.
Could you check it out and suggest what is going wrong?
The text was updated successfully, but these errors were encountered: