Pesky paragraphs – Tiny MCE in Perch

We’ve been trying out the amazing little CMS, Perch for the last few weeks. So far I’ve got to say that it’s pretty awesome. Very fast and extremely stable but most of all it’s going to be so easy for our clients to use.

The only quibble so far, and it’s not Perch that is the problem, is the auto insertion of paragraph tags using the wysiwyg plugins for the editors. Every time you have a text_area and invoke the text editor it automatically wraps the initial content in p tags. There’s an incredibly easy fix for this though. I’m currently using the tinymce plugin for an editor so will use this as my example.

Simply go to the plugin directory (in this instance perch/addons/plugins/editors/tinymce/) and open the file. Inside the function set_up_tinymce you can change the setup to suit your own purposes. In this instance we want to add a line that disables the force root block. So, add

forced_root_block: '',

under the line of code that reads

convert_urls: false,

That’s it.