Forum
Redactor II - HTML/Code View?
I’m saddled with HTML-based content in a client's blog as the blog was migrated from Wordpress.
As much as I wish I could rely solely on markdown, I use Redactor as the editor for the blog portion of my client's website.
I performed a test upgrade of Redactor to Redactor II and compared the two. I note that Redactor II is missing an HTML/code view. I find code views indispensable with HTML-based content, particularly when troubleshooting content that has been copy and pasted from somewhere else.
How would you recommend, within the Perch ecosystem, that I customize Redactor II to allow for a code view?
I’ve gone deep with wysiwyg editor customization before, namely with TinyMCE, so I assume such a thing is possible, but I also would want to make sure I don't step on Perch’s toes in some way I haven't anticipated.
Hi, you would use the Redactor 'Source Code' plugin: https://imperavi.com/redactor/plugins/source/
It shouldn't step on Perch's toes :)
Thanks, Simon! :)
HI both,
I assume you add the code to the _config.inc file?
If so please can you share how you implemented this I am not getting the HTML button to show up :-/
James — I downloaded the source.js plugin script that Simon directed me to and placed it in a "plugins" directory within /perch/addons/plugins/editors/redactor/.
I then amended my _config.inc file like so:
This is working in my dev and production environments. I admit I’m wary that future updates may overwrite my _config.inc. :/
Is it within the Perch terms of agreement if I publish this config file to a public Gist? If so, I can do that, if it would be helpful.
You can do anything you like with your own plugin config file.
Here’s a gist for all who might find this helpful.