Forums / Templates, Stylesheets, Page Layout / sidebox layout problem

sidebox layout problem

Locked

Started by jerry5763837 on 23 Mar 2009, 10:03 AM · Views: 2,771

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
23 Mar 2009, 10:03 AM
#1
jerry5763837 avatar

jerry5763837

Zen Follower

Join Date:
May 2008
Posts:
261
Plugin Contributions:
0

sidebox layout problem

hi, everyone,

Does anybody know how to specify the width for one specific sidebox, such as best_seller

seems that in Zen-cart, all the sidebox always agree to the width of $column_box_default, that is class=.leftBoxContainer or class=.rightBoxContainer, whose width can be set through Admin-->layout setting

Now supposed i set the .leftBoxContainer and .rightBoxContainer to 170px, but i ONLY want the sidebox
best_seller to be 200px, how to achieve this?

Any suggestion would be appreciated.:clap:

23 Mar 2009, 11:14 AM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: sidebox layout problem

I'm not sure if a stylesheet change can override the settings from admin, but maybe if you set the width of that particular sidebox in the stylesheet using the !important addition to the definition, it'll work. See here for how to use !important.

Be sure your column width is set wide enough for the 200px sidebox, or Bad Things will happen.

Rob

Breakfast: the most important donut of the day.

23 Mar 2009, 11:30 AM
#3
jerry5763837 avatar

jerry5763837

Zen Follower

Join Date:
May 2008
Posts:
261
Plugin Contributions:
0

Re: sidebox layout problem

hi, rstevenson,

how genious you are! really appreciated for your great answers.
it works.

but could you please explain further why the MAX. width is 200px?

23 Mar 2009, 11:40 AM
#4
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: sidebox layout problem

Well, you gave as an example of what you're trying to do...> Now supposed i set the .leftBoxContainer and .rightBoxContainer to 170px, but i ONLY want the sidebox

best_seller to be 200px, how to achieve this?

If your left column was 170px wide and you tried to put a 200px wide sidebox into it, either the sidebox wouldn't be 200px wide, or -- more likely -- the column width would be forced out to 200px anyway, and that could throw off other parts of your site design if you're not expecting it.

THIS JUST IN ...

I decided to put it to the test. On my retail site (link below) I entered this into the stylesheet...

#information {width: 200px !important;}

The result was that my Information sidebox expanded right out past the borders of the left column, running right over top of text in the centercolumn area. In my case this would not be a good thing, but depending on your design, this might work for you.

All you can do is try it and see, I guess.

Rob

Breakfast: the most important donut of the day.

23 Mar 2009, 2:10 PM
#5
jerry5763837 avatar

jerry5763837

Zen Follower

Join Date:
May 2008
Posts:
261
Plugin Contributions:
0

Re: sidebox layout problem

hi, Rob ,

Many thanks for your patient explanation.

what great retails sites!!
wonderful job.

23 Mar 2009, 2:11 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: sidebox layout problem

In IE (older versions at least), the whole column may expand to 200px. It is not supposed to according to CSS standards, but we know about IE and standards...

23 Mar 2009, 2:28 PM
#7
jerry5763837 avatar

jerry5763837

Zen Follower

Join Date:
May 2008
Posts:
261
Plugin Contributions:
0

Re: sidebox layout problem

Hi, Glenn,

Can not agree with you any more.

Yes, the whole column expanded to 200 px.

23 Mar 2009, 2:45 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: sidebox layout problem

If you use
margin-right: -30px;
in the individual sidebox rule, it should allow the sidebox to overrun the column edge. Sometimes this might not work in older IE either, though - depends on a hidden IE property "has_layout" which needs to be triggered.

24 Mar 2009, 1:44 AM
#9
jerry5763837 avatar

jerry5763837

Zen Follower

Join Date:
May 2008
Posts:
261
Plugin Contributions:
0

Re: sidebox layout problem

hi, Glenn,

maybe this is the way we want.
will try to test it.