views:

581

answers:

4

Wordpress Tiny MCE editor and WP own editor both has button for <blockquote> . if we select any text and press this buttom then it wraps that text with <blockquote>.....</blockquote>.

I want to change this output to this

<blockquote><div class="quote_start"><div></div></div><div class="quote_end"><div></div></div>...................................</blockquote>

How can i do this manually or is there any wordpress plugin which can do the same?

I want to change behaviour of blockquote button in bot editor TinyMCE and WP own html editor?

+1  A: 

I'm not sure you can use this to add that many divs but tinymce's valid elements config parameter does allow you to replace tags.

http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements

For instance:

tinyMCE.init({
    valid_elements : "blockquote/div[class=quote_start]"
});

Would replace all blockquote tags with a div with the quote_start class.

A better way might be to ignore tinymce here and write a filter for the functions.php file of your theme. http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content. Find all the instances of blockquote and replace it with the code you want.

Jared
A: 

Maybe adding your own button could also be an option?

Some starting point could be this:

http://www.deliciousdays.com/tinymcebuttons/

and/or this:

http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/addButton

hope it helps? Greetz, t..

tillinberlin
A: 

If you want the same functionality in two different editors, you're probably better off writing (or looking for) a Wordpress filter that can replace the code. There's this one but it doesn't seem to be able to handle regular expressions (which you would need to replace HTML tags). Maybe this one can do what you need: Text Filter Suite

Pekka
A: 

Getting both TinyMCE and Quicktags requires mods in two places. Here's how to do the Quicktags: http://website-in-a-weekend.net/extending-wordpress/diy-wordpress-unraveling-quicktags-wordpress-plugins/

Dave Doolin