Issues with djangocms-text upgrade, configuration & custom settings not working in django app
I'm working on a project that uses django, djangocms, and djangocms-text-ckeditor. The project is old and desperately in need of updating, so i'm currently updating these major packages one at a time. Due to djangocms-text-ckeditor no longer being supported and not supporting the latest django or djangocms, I swapped it out with djangocms-text and followed the steps they recommended to migrate/update from ckeditor and the djangocms-text describes itself as ckeditors replacement for django.
However, we had a lot of custom styles & css installed in the old text-ckeditor, and after initially getting djangocms-text to work with the base settings, I started working on adding in all of our custom styles and css, while also playing around with using the tiptap editor (default for text) or using ckeditor4, which comes with djangocms-text.
It seems like I did get the styles to be recognized at some point and I know I was able to at least alter what styles were displayed in the dropdown, but now, after hours of trying, none of my configuration settings are taking effect at all, not even TEXT_INLINE_EDITING = False, which I know worked previously. I could really use some help here, the docs for these things are severely lacking and often in other languages than django
I've scoured our settings.py file and ensured no other code is relevant as well as ensured that text and ckeditor4 are install in installed_apps. I'll give two code snippets that i've tried, one with the default tiptap editor and one with ckeditor4 which came with djangocms-text.
Settings as specified in https://pypi.org/project/djangocms-text/, using the default tiptap editor, nothing here works or takes effect, the styles dropdown doesn't register any changes.
TEXT_INLINE_EDITING = False
from djangocms_text.contrib.text_tinymce import RTEConfig
DEFAULT_EDITOR = RTEConfig(
name='tiptap',
config="TIPTAP",
js=("djangocms_text/bundles/bundle.tiptap.min.js",),
css={"all": (
"djangocms_text/css/bundle.tiptap.min.css",
'/static/css/custom/v1/content.css',
)},
admin_css=(
"djangocms_text/css/tiptap.admin.css",
'/static/css/custom/v1/content.css',
),
inline_editing=False,
child_plugin_support=True,
configuration={}
)
# Also tried this
# DEFAULT_EDITOR.configuration = {
TEXT_EDITOR_SETTINGS = {
"inlineStyles": [ # Styles menu, by default contains some rarer styles
{ 'name': 'Small', 'element': 'small' },
{ 'name': 'Kbdddd', 'element': 'kbd' },
{ 'name': 'Var', 'element': 'var' },
{ 'name': 'Samp', 'element': 'samp' },
# Start of Custom CK Editor Styles
{'name': 'White', 'element': 'span', 'attributes': {'class': 'custom--text-col-white',}},
{'name': 'Main color', 'element': 'span', 'attributes': {'class': 'custom--text-col-color-main'}},
],
}
Here is my attempt to use old ckeditor settings with ckeditor4, it clearly states in the above link that for backwards compatibility, the old CKEDITOR_SETTINGS are still usable, but once again, other than the editor switching to ckeditor4, none of these other changes are taking effect and the styles aren't showing up in the dropdown. I've removed some stuff to save space, but these effects should still work and I've confirmed that just these settings work in our original project with djangocms-text-ckeditor (i'm working on a copy)
TEXT_EDITOR = "djangocms_text.contrib.text_ckeditor4.ckeditor4"
CKEDITOR_SETTINGS = {
'skin': 'moono-lisa',
'stylesSet': 'default:/static/js/addons/custom_ckeditor_config_and_styles.js',
'contentsCss': [
'/static/djangocms_bootstrap4/css/ckeditor_default_font.css',
'/static/css/custom/v1/content.css',
],
}