I do a lot of image in my blog to hopefully make it more interesting to people visually. especially in my sistersite which is beer reviews. A few things have bothered me since I installed MT, but haven't been a big enough issue to deal with.
1. Limited size of Entry Body window, and no obvious way to edit it. (which I figured out, and led me to this next one)
2. Having to type out the image html manually every time:
CODE
<img src="http://dennisjudd.com/albums/beers/IMGPxxxx.thumb.jpg">
Anyways, long story short, I added this to /tmpl/cms/edit_entry.tmpl right after the "function insertLink":
CODE
}
function insertImg () {
if (!document.selection) return;
var str = document.selection.createRange().text;
if (!str) return;
var my_link = prompt('<MT_TRANS phrase="Enter Image URL:">', 'http://');
if (my_link != null)
document.selection.createRange().text = '<img src="' + my_link + '">';
function insertImg () {
if (!document.selection) return;
var str = document.selection.createRange().text;
if (!str) return;
var my_link = prompt('<MT_TRANS phrase="Enter Image URL:">', 'http://');
if (my_link != null)
document.selection.createRange().text = '<img src="' + my_link + '">';
and then added this button to the edit page:
CODE
document.write('<td width="26"><a href="javascript:insertImg()"><img src="<TMPL_VAR NAME=STATIC_URI>images/img-button.gif" alt="Image" width="26" height="18" border="0"></a></td>');
and I made a button....
[IMG]http://www.dennisjudd.com/dj-static/images/img-button.gif[/IMG]
The only bad part so far is that you can't just click the funtion button, you have to put a "place holder" in, highlight it, and then it gets wiped when the img src code goes it.....but hey, at least I didn't "bork" it