rispost

Image resizing in Blogs

January 2nd, 2009

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’;
}
}
);
});

1 Comment »

  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!

    Comment by Chris Whisonant — July 10, 2009 @ 8:20 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Please leave these two fields as-is:
   
© LOTUSCONNECTIONS.org , Designed by Stealth Settings
Entries (RSS) and Comments (RSS)