Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / new/featured Columnar layout help

new/featured Columnar layout help

Locked

Views: 3,960

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
2 Oct 2006, 1:09 PM
#1
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

new/featured Columnar layout help

My new site is live , but I have an issue with the layout for featured and new products that apear in a 3 by 3 grid on the main page , and on some category pages under neath the default rows.

If you take a look at https://www.tapes-direct.co.uk you will see the featured producs name rolls into each other in some resolutions , idealy i would like to pad these out restrict the text to similar width to the image or at least put a border around them.. . .

BUT as soon as I add a border , they wrap , plus because they align top , the boxes are all differnet sizes and it looks rubbish.

Any ideas on a fix or workaround for this greatfully accepted.

2 Oct 2006, 4:33 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: new/featured Columnar layout help

Try finding or adding these to your css

.centerBoxContentsNew {
padding 0.1em;
}

.centerBoxContentsFeatured {
padding 0.1em;
}

See if this renders a bit better or not

3 Oct 2006, 11:04 AM
#3
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: new/featured Columnar layout help

Thanks for the reply , but still wraps under , as soon as you make the screen smaller than 1050 x ... ( using firefox web developer resize tool )

It's as if im using more than 100% of the screen , maybe as I had to push my sideboxes out to 220px , its not left with much room.

I hope to find a way to just make the text under the product image narrower , possible by putting it in its own td or div !

Thanks for any help.

3 Oct 2006, 11:49 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: new/featured Columnar layout help

Thanks for the reply , but still wraps under
Well, yes, if I am understanding correctly,. where do you think all that text is going to appear? I have viewed at 1024x768 and 800x600 and there appears to be correct rendering but a bit more space between them would not hurt. It looked like this:

High Performance - BLUE lane
 marking tape 50mm x 33M
          £9.44

Is this what you see and are concerned with?
The text is a div right now and I do not understand how a table will make it smaller??
you might try :

.centerBoxContentsNew {
     margin: 0.03em;
     }

.centerBoxContentsFeatured {
     margin: 0.03em;
     }
```and adjust as you see fit maybe 0.05 or 0.02??
3 Oct 2006, 12:11 PM
#5
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: new/featured Columnar layout help

ahhh , maybe I didnt explain well , and we are talking about differnt things ...

Some screen shots needed maybe !!!

YOu should be able to see the text running in to each other on this screent shot.

when I try to put margins , or padding on them it does this :

Sorry if not clear , or we are talking about the same thing , just im seeing different results !

EDIT : Embedding didn't work , sorry .. back to forum class !

3 Oct 2006, 12:41 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: new/featured Columnar layout help

Thanks for the pic's...I think that we are talking about the same thing as when I applied too much padding or margin it consumed too much space and moved the right most image down as your pic displays.

Back to your first image, this is not what I see at 1024x768 and can add 0.01 or.02 em without wrapping

3 Oct 2006, 1:45 PM
#7
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: new/featured Columnar layout help

OK Yes I see that working now . as you say , not much em space to play with
would it help if I narrowed the right column a few PX , would that give me more padding room in the center column .

Thanks again

3 Oct 2006, 2:12 PM
#8
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: new/featured Columnar layout help

In response to my own post , Ive changed the right column width down 20px to 200
and it doesnt make too much difference to the layout , and you still dont have much space to play with , of course em is a percentage thing , so increasing them had the same affect .

So kind of a new question , but would it be possible to limit the width of the text under each image to 100px for example ?

4 Oct 2006, 12:55 PM
#9
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: new/featured Columnar layout help

Ok , Ive kind of frigged the code to get this to look a bit better , its not ideal , and would appreciate any feedback from you expert php, html , css people out there .

I changed the code in featured_products.php

 // show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
    $col_width = floor(100/($num_products_count+0.9));
  } else {
    $col_width = floor(100/(SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS+0.9));
  } 

Adding the +0.9 to the calculation to get the max available size ( i think thats what its doing ) so by increasing the products number , the division means more space for my products to live in ! and more padding available.

It really is not ideal , and if someone can help with leaving this bit of code original , and changing it so that the text bit of the product description goes into a fixed size area under the image , that would be fantastic.

Cheers

4 Oct 2006, 1:15 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: new/featured Columnar layout help

I actually noticed after being inspired by your post that this is auto dividing the available space to 33%. try finding this in your css and separate it out from it's current entry as it is defined with a margin. .centerBoxContentsFeatured

and placing it as a separate entry try this first:

.centerBoxContentsFeatured {
     width: 30%;
}

Now this should, due to float register all at 30% and left aligned so now play with adding either padding or margin and this can be all around or left & or right to center it up again.

.centerBoxContentsFeatured {
     width: 30%;
     margin: 0.5em;
}

When you get this sorted, do the same for the new tag & others as you might need.
You might first back out your file edit

5 Oct 2006, 2:15 AM
#11
mattdownunder avatar

mattdownunder

New Zenner

Join Date:
Sep 2006
Posts:
14
Plugin Contributions:
0

Re: new/featured Columnar layout help

Having the same problem.
I got rid of everything in the right column so my shop has only left column and products. Everything works fine but on the "home" page the "New Products for October" should have 3 colums. It only shows 2 images and wraps the third image in a new line.

Changing the margins in the css did not help.

Any thoughts

Matt

5 Oct 2006, 11:32 AM
#12
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: new/featured Columnar layout help

Somethings should be notice for the width of the Columnar layout.

At first, the cells in the columns are divided and depended on the defines in admin.
If the define are:
set to 2 then each cell's width is 50%, set to 3 then each cell's width is 33.3%, set to 4 then each cell's width si 25%, ...

But those widths are different than orthers. When adding style to those cells or some unknow factors in the page will "add overhead" to those widths. Thus the total values of the width will be more than 100%. And this cause insufficient width for the last cells to sit inside the same row and it just drop to next row.

When found that the last cells are droped to the next row, or a style added to the cells and caused the cells droped to next row.

The followings in stylesheet may help. It can be solved by some compensations, is to reduce the widths of the cells and by adding negative values to the margins. And the negative values must be more than the sufficient.

For example in the following, borders are added to the cells and in normal conditions the last cells will drop to next row for sure.
But if sufficient negative values are added to the margins, then the last cells will not drop.

/* Index Page, Center Box Contents */
.centerBoxContentsNew, .centerBoxContentsFeatured, .centerBoxContentsSpecials, .specialsListBoxContents {
	border-top: 3px solid #E7E7E7;
	border-left: 3px solid #E7E7E7;
	margin-left: -4px; 
}

Note: in above

  1. for added a 3 px border-left to the cell, therefore need a sufficient negative values of -4px or more to reduce the overhead and from the margin.

  2. For don't want to display all the cells as un-uniform and ugly boxes, therefore only the border-top and border-left are added.

And to style the item names /titles inside the cell, also some cares are needed. It is link text and combined with the images.
May try the follwoing:

/* Item names /titles of Index Page, Center Box Contents */
.centerBoxContentsNew a, .centerBoxContentsFeatured a, .centerBoxContentsSpecials a, .specialsListBoxContents a {
	display: block;  /* override previous style */  
	text-align: center;
	padding-left: 1em;
	padding-right: 1em;
}

.centerBoxContentsNew br, .centerBoxContentsFeatured br, .centerBoxContentsSpecials br, .specialsListBoxContents br {
	line-height: 0;  /* override the height of display: block above */
}

Hope this helps. :smile:

5 Oct 2006, 12:15 PM
#13
mattdownunder avatar

mattdownunder

New Zenner

Join Date:
Sep 2006
Posts:
14
Plugin Contributions:
0

Re: new/featured Columnar layout help

Your da man.

I added:
/* Index Page, Center Box Contents */
.centerBoxContentsNew, .centerBoxContentsFeatured, .centerBoxContentsSpecials, .specialsListBoxContents {

margin-left: -11px; 

}

to the css and it works it worked from -9 on and I just thought I'll make it a bit more.

I did not get the meaning of the second code. In my case it might be text that is too long so it won't fit in the cell.

Thanks so much for your detailed answer

Matt

5 Oct 2006, 12:39 PM
#14
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: new/featured Columnar layout help

MattDownUnder:

I did not get the meaning of the second code. In my case it might be text that is too long so it won't fit in the cell.

Thanks so much for your detailed answer

Matt
I also had thought about it. :P

The second code is for styling the paddings of left and right and centering of the Product Name.
For the time being, it may be the best result I can achieve. I can tell, since v1.3.x, I had tried and tried and this was the last minute effort.

5 Oct 2006, 1:07 PM
#15
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: new/featured Columnar layout help

MattDownUnder:

Your da man.

I added:
/* Index Page, Center Box Contents */
.centerBoxContentsNew, .centerBoxContentsFeatured, .centerBoxContentsSpecials, .specialsListBoxContents {

margin-left: -11px;
}

to the css and it works it worked from -9 on and I just thought I'll make it a bit more.
For better result and for the cetnering, the negative value should be reduced from both of the left and right margins.
For your case, it should better be

margin-left: -6px;  /* use 6px only for no 5.5px */
margin-right: -6px;  /* use 6px only for no 5.5px */