
This FAQ is applicable for the following situations: You're receiving the following error in the Javascript console: WebSocket connection to 'wss:///socket...
faviconNodeBB Community (community.nodebb.org)
Hello,
First and foremost, i want to congratulate the developers on the amazing work done so far. NodeBB seems to be heading for success, let's hope so :).
Beforehand, I want to say I'm a novice programmer, and that i'm not used to modifying this kind of systems, namely forums and blogs and such (i'm referring to using hooks and such patterns), so I might be asking stuff that should be obvious..
Now, for my question:
How can I implement on nodebb a medium like editor like, for instance, this one? Is there one implemented?
I need to have a WYSIWYG editor for a forum I want to implement because my average user will likely be driven away because of a markdown editor. Not that I have empirical proof of that, but please humour me
My approach so far:
After having a go at a custom theme + widget (my first reasoning as to change the dual box layout and applying the script) without much success, I went for some monkey patching:
**My reasoning: **
The medium editor styles must be aplied to an htm tag other than textarea so I think I can use the preview container which is a div, and I imagine its the one going to be sent to the db, so it should work.
My problems so far:
script location:
theming:
requirejs conflict? :
My questions:
Sorry for the long post..
thanks in advance!
That's an ambitious project for your first plugin... good luck
Instead of including this script, maybe you should use require.js to load it?
<script src="medium-editor.js">
Like this and I had to make a change in the lib itself like this to add the namespace
Also, the templates found in public/templates
are compiled from themes and plugins. So you would either create a new plugin with a template directory containing a file called composer.tpl
and it will overwrite the default theme's composer (the order of precedence is: core templates get overwritten by the base theme template, which gets overwritten by the custom theme's template, which finally gets overwritten by plugins.) Hope that makes sense
Lastly, I would make this a plugin not a theme, so that other themes can use your composer.
@psychobunny thanks for your reply!
Your answer makes sense, i'll try to implement it as a plugin by looking at other plugins an trying to reason from there. I'll get on it tomorrow morning
I really wanted to dig deeper inside the mechanics behind nodebb.
Where do you think I should I start so I could get a good grasp of the whole system?