If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Basic Configuration / definition of BOX_WIDTH_SINGLE

definition of BOX_WIDTH_SINGLE

Locked

Started by mzimmers on 3 Mar 2010, 11:16 PM · Views: 805

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
3 Mar 2010, 11:16 PM
#1
mzimmers avatar

mzimmers

Zen Follower

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

Post #1 by mzimmers

Hi –

My site is in single-column configuration. In trying to determine the width of the sidebox, includes/modules/column_single.php performs the following test:

if (defined('BOX_WIDTH_SINGLE')) {
  $column_width = BOX_WIDTH_SINGLE;
} else {
  $column_width = BOX_WIDTH_LEFT;

As far as I can see, this is the ONLY reference to BOX_WIDTH_SINGLE that I can find in the entire system. What have I missed?

Thanks.

4 Mar 2010, 10:49 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #2 by stevesh

When you say that your site is in single column configuration, what exactly do you mean?

In Admin - Tools - Layout Boxes Controller, the 'single column' status and sort order don't do anything except with the header search bar.

If you have a single (right or left) sidebox column, its width is set in Admin - Configuration - Layout Settings and the overall width is set in the stylesheet in #mainWrapper.

4 Mar 2010, 5:11 PM
#3
mzimmers avatar

mzimmers

Zen Follower

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

Post #3 by mzimmers

Hmm...I thought I replied to this already, but I guess it didn't "take."

My site has only one sidebox column (on the left). Per the template author's recommendation, I've widened it from 150px to 200px. Within the left column is the search tool. The width of the search box is derived from templates/CUSTOM/sideboxes/tpl_search.php as follows:

$content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 

And, as noted above, $column_width comes from BOX_WIDTH_SINGLE. But, there the trail ends -- I can't find where that is defined anywhere.

So...any ideas what's going on here? I'd assumed that BOX_WIDTH_SINGLE was some kind of system constant, but the developer tools reveals nearly nothing.

Thanks.

4 Mar 2010, 5:29 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Post #4 by gjh42

For technical consistency, "single-column" means just one (center) content column; one sidebar would be a "two-column" layout.

/includes/modules/column_single.php

Line #24 : if (defined('BOX_WIDTH_SINGLE')) {

Line #25 : $column_width = BOX_WIDTH_SINGLE;

I believe column_single.php would only be used if the site were set to single column "sidebox" mode, which is not actually available. I think that mode was an early developmental experiment which has not been completed, and the devs didn't remove the code because it might one day be used.

4 Mar 2010, 5:34 PM
#5
mzimmers avatar

mzimmers

Zen Follower

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

Post #5 by mzimmers

gjh42:

For technical consistency, "single-column" means just one (center) content column; one sidebar would be a "two-column" layout.
Thanks for the clarification.

/includes/modules/column_single.php

Line #24 : if (defined('BOX_WIDTH_SINGLE')) {

Line #25 : $column_width = BOX_WIDTH_SINGLE;

I believe column_single.php would only be used if the site were set to single column "sidebox" mode, which is not actually available. I think that mode was an early developmental experiment which has not been completed, and the devs didn't remove the code because it might one day be used.

OK...so how would you recommend I do this? I could just hack the assignment of the width to $column_width minus 10 instead of minus 30, but that seems rather amateurish.

4 Mar 2010, 5:50 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Post #6 by gjh42

Are you working on /includes/templates/your_template/sideboxes/tpl_search.php? It does seem to me that editing that -30 to -10 would be the most appropriate method.
Alternatively, you could override the coded

style="width: ' . ($column_width-30) . 'px"

with a stylesheet rule like

#search input {width: 95% !important;}

Modify the selector as required to actually apply to the input box - I don't have one available to check at the moment.

4 Mar 2010, 5:50 PM
#7
mzimmers avatar

mzimmers

Zen Follower

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

Post #7 by mzimmers

Update:

OK, I traced back to a constant called BOX_WIDTH_LEFT, which seems to be used. It's set to 150px. I know when I installed this template, I increased the width of something (pretty sure it was the left column) to 200px. I guess you have to change the width of the boxes as well as the column itself?

4 Mar 2010, 5:56 PM
#8
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #8 by stevesh

Yes. Both settings are in Admin - Configuration - Layout Settings

4 Mar 2010, 11:20 PM
#10
mzimmers avatar

mzimmers

Zen Follower

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

Post #10 by mzimmers

Yeah, that was the problem: I neglected to realize that I had to change the column width as well as the box width. The BOX_WIDTH_SINGLE constant was a red herring.

Thanks.