Forums / Templates, Stylesheets, Page Layout / Selectively Use Proportional Images on Products and Categories

Selectively Use Proportional Images on Products and Categories

Locked

Views: 2,156

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
7 Apr 2007, 3:48 PM
#1
outlawlb avatar

outlawlb

New Zenner

Join Date:
Jan 2007
Posts:
86
Plugin Contributions:
0

Selectively Use Proportional Images on Products and Categories

Is it possible to set it up so that each image can have this option individually turned on or off or is there a way to adjust the proportions used on each image?

I also have Image Hander 2 installed.

You can see the problem I am having here: http://jeffdavidcasting.com/catalog/index.php?main_page=index&cPath=5

I want each image to be the same size using the proportions as the images I have are not all of the exact same proportions.

Basically I want to have its container for 28508L be the same size as all the others.

Thank you.

7 Apr 2007, 4:25 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Selectively Use Proportional Images on Products and Categories

You may be mistaking the function of "proportional images". Its purpose is to make images keep their original proportions and not be distorted to fit the given box; therefore, you probably always want this on.
What you want is for the container that holds the image and name to match the others, correct? If you can say that none of the boxes will be higher than the ones showing on that page, then you can give .centerBoxContentsProducts a fixed height in your stylesheet and the outlines will all match.
The name text will still be just below the image; if you want that at the bottom of the box you will need to use a different tag to style.

7 Apr 2007, 5:49 PM
#3
outlawlb avatar

outlawlb

New Zenner

Join Date:
Jan 2007
Posts:
86
Plugin Contributions:
0

Re: Selectively Use Proportional Images on Products and Categories

Thank you know I know what I means (as I thought it served a slightly different purpose) and how to fix it.

But I can not find .centerBoxContentsProducts in my stylesheet. (I do see it when I view the source of my page.)

<div class="centerBoxContentsProducts centeredContent back" style="width:24.5%;">
``` and such
Where is it and/or how should I define it then?

Also how could I ensure that the image is aligned to the center and the text to the bottom.  Do I use the same aspects in the style sheet? Same .centerBoxContentsProducts tag?
7 Apr 2007, 6:26 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Selectively Use Proportional Images on Products and Categories

Since it is not already styled, adding

.centerBoxContentsProducts {
    height:124px;
    }
```to your stylesheet will give all the boxes the same height.

Moving the image and text will be trickier. They don't want to move inside the fixed box as is, so I think you will need to add a wrapper to .listingProductImage, say .listingProductImageWrapper. I don't use the column grid mod so can't tell you exactly which file or line it should go in. Find the place where (I think) $listBoxContents is built...

Once you have a .listingProductImageWrapper div in the code, you can style it.
```php
.listingProductImageWrapper {
    height: 100px;
    }
//now you can align the image
.listingProductImage {
    vertical-align: middle;
    }
//and the title will already be at the bottom of the box so no need to style it
#productListing h3.itemTitle {
    }
7 Apr 2007, 6:53 PM
#5
outlawlb avatar

outlawlb

New Zenner

Join Date:
Jan 2007
Posts:
86
Plugin Contributions:
0

Re: Selectively Use Proportional Images on Products and Categories

Weird I can not find listingProductImage, either.

Just so you know my template is mostly classic with just the colors changed.

I can not find the place where the layout aspects are defined, especially for the images.

Is it possible that I could just add this to the stylesheet, and then it would execute it?

If I did it your way could I do this in the code:

'class="listingProductImage"'

to

'class="listingProductImage listingProductImageWrapper"'

Or do I have to do something different?

here is the full line that I think applies to me: ```
else {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'

7 Apr 2007, 7:17 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Selectively Use Proportional Images on Products and Categories

Looks like you found the right area to edit.
Adding another class in the same place won't help; you need to wrap the image link so the wrapper can have a height and the image can be positioned inside it. I would say to use <span class="listingProductImageWrapper">(link code)</span>.

Something like ```php
$lc_text = '<span class="listingProductImageWrapper"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a></span>'

9 Apr 2007, 12:45 PM
#7
outlawlb avatar

outlawlb

New Zenner

Join Date:
Jan 2007
Posts:
86
Plugin Contributions:
0

Re: Selectively Use Proportional Images on Products and Categories

Thank you for all your help I will give it a try and let you know how it works.

11 Apr 2007, 3:54 PM
#8
duntuk avatar

duntuk

New Zenner

Join Date:
Oct 2006
Posts:
10
Plugin Contributions:
0

Re: Selectively Use Proportional Images on Products and Categories

I'm trying to do the same thing--wrap the image in a a div so to be able to style it with a border and center the content/image. However, I can't find where in the world that code is..... i'm using the column display mod as well, plus image handler 2...

14 Mar 2009, 5:56 AM
#9
carlnunes avatar

carlnunes

New Zenner

Join Date:
Mar 2009
Posts:
7
Plugin Contributions:
0

Re: Selectively Use Proportional Images on Products and Categories

Yes, thank you. This stuff is hard to find.