Image resizing in Blogs

The default behavior for images used in Blog post is to be scaled down to a
maximum of 350px, both width and height, aspect ratio is kept.

This is not really handy for screenshots that are posted on Blogs.

Thanks to the reply of Chris Whisonant at the Lotus Connections forum
I learned how to configure this behavior.

http://www-10.lotus.com/ldd/lcforum.nsf/DateAllThreadedweb/42a2b16da056408bc12575210040b42f?OpenDocument

Made some extra edits so that scaled down images are clickable and a
full version of the image opens in a new window when you click on it.

Tested it with Firefox and IE

Changed the code in the file _day.vm as follow.

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/localhostNode01Cell/Blogs.ear/blogs.war/themes/blog # vi _day.vm

function openImage(item)
{
window.open(item);
}

dojo.addOnLoad(function(){
dojo.query(‘.entryContentContainer img’).forEach(
function(item){

if(item.style != undefined && item.style.width != undefined && item.style.width == “100%”)
return;
if (item.width > 400) {
item.height = item.height * (400/item.width);
item.width = 400;
item.onclick=function(){openImage(this.src)};
item.style.cursor=’pointer’;
}
}
);
});

This entry was posted in lotus connections and tagged . Bookmark the permalink.

One Response to Image resizing in Blogs

  1. Hi there! I’ve just recently stumbled upon your blog – I like it a lot. And I see you mention me in this post lol… 🙂

    Anyway, if you’re not familiar with me or my company Lotus 911, we run http://www.bleedyellow.com which is a Lotus Connections site with a lot of Lotus Blogs with some great activity. Stop by and say hi sometime!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 807,335 bad guys.