-2

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)?

PookyFan
  • 785
  • 1
  • 8
  • 23
  • 1
    wysiwyg packages for django https://djangopackages.org/grids/g/wysiwyg/ - what have you attempted so far to make it work? Give us something to work with. – Nrzonline Feb 23 '17 at 15:46
  • So far I was just looking for a solution that would seem typical to django, such as including a template or using templatetag. I was also trying to find information in django cms documentation, since it seems like it would be a popular functionality. I was rather surprised there's no such thing described anywhere, neither in docs nor in the internet (I also tried to find similiar question here, with no luck). Haven't tried any actual coding, I don't even know if it makes sense to install any external editors. – PookyFan Feb 23 '17 at 16:55
  • "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." What form would you like to have? If the available plugins (like the text plugin) don't offer what you're looking for, you can easily create own Plugins that can be placed in page placeholders. Those plugins can use the same editor as the text-plugin for their text/html form fields. – Max Feb 23 '17 at 17:49
  • @Max butt the Text plugin is managed from django admin panel. I'd like to have a form on the page available for users, so that this form would consist of WYSIWYG editor, either similiar to this one used by admin to manage Pages plugins, or - even better - exactly the same editor (so I don't have to install additional extensions). The question is, how to do that without any dirty tricks. – PookyFan Feb 23 '17 at 19:08

2 Answers2

2

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.

Fabian
  • 571
  • 5
  • 24
  • I already went with another solution (similiar to what you're linking, just using another WYSIWYG editor), but this too looks promising. But since this is more of what I was looking for in the first place, I guess I need to change accepted answer to yours. – PookyFan Mar 06 '17 at 14:27
  • Perfect. It probably is convenient to use the same text editor that you are using for your text plugins. – Fabian Mar 06 '17 at 16:41
  • It is, thus this question. But since it turns out that it needs more "dirty work" to be done so it would work, I just went with third party editor. – PookyFan Mar 06 '17 at 19:11
0

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

Max
  • 1,011
  • 1
  • 13
  • 20
  • The users may or may not be logged in, but I certainly don't want them to access admin panel. Also, there's no simpler way than creating a plugin, then? – PookyFan Feb 23 '17 at 19:34
  • It's completely unclear what you're trying to achieve. What should happen, after the content is "submitted"? It's custom functionality, just build a proper plugin/app. – Max Feb 23 '17 at 19:39
  • Consider a website where users can post their own articles. After writting them, using fancy WYSIWYG editors, they submit the article like any other form so application server could use it, for example, to create an Article object to be used as plugin, which could be then put in placeholder on new Page. – PookyFan Feb 23 '17 at 20:07