Hi this is a long shot i think but here goes.....
Basically i have a few custom plugins and apps being used in my django /django-cms site. I have set tinymce up which is working fairly ok however what im wondering is it possible to use the built in text plugin for the TextField model fields in my custom plugins and apps?
so in effect the info text field for my main content plugin would actually render in the admin site as the text plugin
Like i said i think this is a long shot...
You cannot use single-plugins on models, however you can define PlaceholderFields on your custom models to put cms plugins in. So you can define a PlaceholderField, put a TextPlugin inside that placeholder and do whatever you want.
For more information, read the official documentation about this http://docs.django-cms.org/en/2.1.3/extending_cms/placeholders.html
I also had this requirement (formatted text on a django-cms plugin configuration) and ended up with the following workaround:
I installed django-tinymce and changed my TextField to an HTMLField in the CMS plugin configuration model. This will render a tinymce text editor in the plugin configuration form. You can then use the input from the HTMLField in your plugin template with the ...|safe filter.
Related
I am trying to add the (inline) CKEditor 5 to an existing django project.
From what I understand the inline version does not work with textarea elements but rather with div's. However the django forms do not have div widgets. I'm not entirely sure what is the best way to proceed from here. I can make the editable div show up using the steps in the documentation. But how do I associate it with a form and / or pass the text on to my views?
Rather than doing this manually with django, there's already a package you can import to your project: https://github.com/django-ckeditor/django-ckeditor.
You can see other WYSIWYG editor django integrations at https://djangopackages.org/grids/g/wysiwyg/
Recently I started using Django CMS, it turns out to be a great tool for web developer. But one thing I couldn't have achieved so far is creating a form for users so they could submit some content created with WYSIWYG editor. I thought maybe there's some easy way to add editor available in admin panel (the one you use with creating / modifying Text plugins), doesn't seem like that unfortunately.
Long story short - I'd like to enbable users to use the same WYISWYG editor available from admin panel, without giving them permission to access admin panel. Is it possible? Or do I have to use some additional extension so I could embed similiar editor on my Page(s)?
Maybe you should look into divio/djangocms-text-ckeditor. It offers a HTMLFieldto be parts of models and a TextEditorWidgetto be parts of your app's forms.
So based on the comments I assume, when you say "users", you mean anonymous site visitors that are not registered to the CMS? And you want to display a WYSIWYG form field to them to "submit some content"?
If my assumptions are correct, you just need to create an own plugin or maybe an app.
See http://docs.django-cms.org/en/release-3.4.x/how_to/custom_plugins.html
I'm working on a django project, and I'm trying to implement a textfield form field with tinymce and filebrowser (or another solution to upload images and insert them into my text field content). I have check the aisayko package but seems like only run on admin site, and my form particularly, is not in the django admin site. how can I enable file uploads in my textfield usign rich text editor like tinymce? Thanks.
I'm using django_markdown to save the markdown text in django admin. Is there some better application which can show real-time preview as in stackoverflow while writing?
I didn't notice any Django app which can handle that, but there is StackOverflow js library(pagedown) which can do it- you just have to replace widget in admin form.
http://thegoods.aj7may.com/django-bootstrap-markdown/
I developed this live preview markdown widget for Django. I Used it for my blog. I believe you could replace the textarea widget in the admin with this markdown widget.
I need to plug in reach text editor to admin page of flatpages. And I don't know, what the template are used to falatpages administration?
Update:
One way is to use the django-tinymce app which supports the TinyMCE rich text editor. There's also an example of using the widget with a flatpage form.
Old:
The default template should reside at "flatpages/default.html" but you can customize this through the admin interface. See the Flatpage templates section in the django docs for more information.
In addition to answer to my question. For admin panel of flatpage used default chenge_form.html. But if you customized it for your app, it wouldn't be work for flatpages without explicit destination.