Sep
2nd

Blockquotes in Wordpress - Part II

I wrote a post a while ago about how to utilize nice images for your open and closing quotes utilizing style sheets. Wordpress comes with two editors, a basic one and TinyMCE. I don’t utilize TinyMCE but you might want to if you don’t know HTML. My reason is that I like to embed videos once in a while and TinyMCE does not play well.

How can I modify the Wordpress editor to automatically add the blockquote div tag combination?

Back to my point… my tip was to utilize a blockquote div combination. After I set this up in the stylesheet, I found it was a pain in the neck to keep typing in my div tags. So I did some digging and identified the javascript for the basic editor.

The javascript file that controls the basic editor is /wp-includes/js/quicktags.js. I searched and found the blockquote button at line 60:

Original:

edButtons[edButtons.length] =
new edButton(’ed_block’
,’b-quote’
,’\n\n<blockquote>’
,’</blockquote>\n\n’
,’q’
);

Updated (I also removed the extra return in each tag by removing one ‘\n’):

edButtons[edButtons.length] =
new edButton(’ed_block’
,’b-quote’
,’\n<blockquote><div>’
,’</div></blockquote>\n’
,’q’
);

Now, when I click the b-quote button, it automatically adds the necessary div tags so that I get the closing quote image per the CSS hack!

RSS feed | Trackback URI

1 Comment »

Comment by no imageمهدی (SezWho)
2007-06-17 03:34:17

thanks. this very useful for me. متشکرم
Rate this:
1.6
 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

My Comment Policy: I moderate comments. Please be patient:

  • Spam will happily be destroyed.
  • Use your real name, not some keywords. Otherwise it will be destroyed.
  • Mean comments aren't necessary. If I don't post them I will reply personally to let you know why.
  • Lewd comments will be edited, I don't want my readers leaving because of offensive content.
Great debate, criticism and colorful commentary is always appreciated and approved!