2👍
I had the same problem, now I solved it successfully
just focus on simple steps to implement RichTextBox in Django-cms using (favorite editor) ckeditor:
models.py
from djangocms_text_ckeditor.models import AbstractText
class TipSlide(AbstractText):
pass
cms_plugins.py
from djangocms_text_ckeditor.cms_plugins import TextPlugin
from models import SlideModel, TipSlide
class TipSlidePlugin(TextPlugin):
name = u'Tip Slide Ads'
model = TipSlide
render_template = "slide/tipslide.html"
plugin_pool.register_plugin(TipSlidePlugin)
tipslide.html
<div>
<div class="container">
{{ body|safe }}<!-- The simple plugin -->
</div>
</div>
the result is:
0👍
I think you have to do this because you dont pass the Description instance inside in the context instance.descripton
toinstance
def render(self,context,instance,placeholder):
print "contexttttttttttttttttttttttttttt"
context.update({
'instance': instance,
'object':instance,
'placeholder': placeholder,
})
return context
- [Answered ]-How to get a property of all records in django sqlite3
- [Answered ]-Unicode errror from Haystack indexing
- [Answered ]-Django Rest Framework – do not return url if imagefield doesnt exist
- [Answered ]-Python/Django circular dependency with models.py (NOT in ForeignKey.etc)
0👍
You cannot name your model fields the same as any installed plugins lower- cased model name, due to the implicit one-to-one relation Django uses for subclassed models.
See warning end of “3.5.Storing configuration” section:
http://docs.django-cms.org/en/3.0.1/extending_cms/custom_plugins.html#storing-configuration
- [Answered ]-Display multiple pictures generated by matplotlib with parms from POST in Django
- [Answered ]-Nginx server edit to allow iframe from any site
- [Answered ]-What do the colours mean in Terminal when running Django server?
- [Answered ]-Mod_wsgi with Django 500 error
- [Answered ]-Django REST Framework after PUT/PATCH action
Source:stackexchange.com