BBCode and image size in comments

Creating and modifying plugins.
Post Reply
locojoe
Regular
Posts: 42
Joined: Wed Oct 25, 2006 12:58 am

BBCode and image size in comments

Post by locojoe »

I want to allow visitors on my site to include an image in their comment. I installed the BBCode plugin and that works fine. Where I run in to a problem is if the visitor includes a large image it distorts the layout of my site. I worked around this by setting the width attribute of the image in the BBCode plug in to 550px which is the width of my entry. That works fine. Now the problem is I'm also using the Recent Comments plug in to display comments on the side bar. Of course even at a width of 550 that's way to large for the sidebar and distorts it.

I went back and set the image width attribute to 100%. That worked perfect in Firefox. It only displayed the image at the width of the table that is was in. I then checked it out in IE and found IE displays the image at full size.

I'm wondering how I can work around this. Either have the image display smaller in the Recent Comments on the sidebar or to not display at all in the side bar wold be ok.

Any suggestions?

Thanks.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: BBCode and image size in comments

Post by garvinhicking »

Hi!

Since the sidebar containers all are wrapped into a class, you should be able to attribute images there specifically:

Code: Select all

#serendipityRightSideBar .serendipity_plugin_comments img {
 width: 100px;
}
(YMMV - it depends on your actual blog style on what to pick exactly. If you give us your URL, we can be more specific)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply