MovableBlog: Custom Tag Buttons in Edit Entry screen

Nuance 2.0

November 23, 2002

Adding custom buttons to your Edit Entry screen is a lot easier than I thought would be. First, go to the mt/tmpl/cms directory, and make a backup of edit_entry.tmpl. I did this using the following Unix command:

cp edit_entry.tmpl edit_entry.tmpl.bak

Now, edit edit_entry.tmpl and search for the first occurance of the word "bold". Copy everything from document.write to the semicolon on the same line, paste what you have, and change the "bold" in the new code to whatever tag you want. I did it for blockquote:

document.write('<td width="24"><a href="javascript:formatStr(\'blockquote\')"><img src="/mt/images/blockquote-button.gif" alt="bold" width="24" height="18" border="0"></a></td>');

The hard part is creating individual buttons for each new tag. I created one for blockquote, and you can use the blank image I created .

This'll save you some time if you're too lazy to type in your favourite simple tags (like <small> and <em>) that aren't available by default on the MT Edit Entry screen. Remember when you upgrade that you may need to change your edit_entry.tmpl file again. Also, if your tag needs are a bit more complicated, you may want to investigate the MTMacro plugin. I hear it's pretty good.

Posted by Richard at 7:11


thx, works great!

Thank you! Easy to use explanation and very helpful tip.

THANKS! :) Works perfectly!