Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / need help with lay-out of image and text on product page

need help with lay-out of image and text on product page

Locked

Started by koenvandamme on 5 Mar 2009, 1:44 PM · Views: 1,519

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
5 Mar 2009, 1:44 PM
#1
koenvandamme avatar

koenvandamme

New Zenner

Join Date:
Feb 2009
Posts:
53
Plugin Contributions:
0

Post #1 by koenvandamme

Hi,

On my product pages I have a picture of the item with a short description in bullets to the right of that image. If the text is longer than the height of the image, it continues below the image instead of on the right side.

Also, I would like for the image and the text to start at the same height (again, see screenshot please).

It would be greatly appreciated if anyone could point me in the right direction. My shop: http://www.mylittletoy.com/index.php

5 Mar 2009, 2:56 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,190
Plugin Contributions:
0

Post #2 by haredo

koenvandamme:

Hi,

On my product pages I have a picture of the item with a short description in bullets to the right of that image. If the text is longer than the height of the image, it continues below the image instead of on the right side.

Ko,
Question 1

Edit your_template/ stylesheet.css

Locate this element #productDescription

If not there add to the sheet

#productDescription {margin-left: 13em;}

  1. the red font highlighted above you will half to play with
  2. But this is fun to learn how the stylesheet.css controls the web page functions

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

5 Mar 2009, 3:10 PM
#3
pjb923 avatar

pjb923

Zen Follower

Join Date:
Jan 2005
Location:
NY
Posts:
135
Plugin Contributions:
0

Post #3 by pjb923

This is a problem that I always had with the stock product info page. My solution is to create 2 columns. In the tpl_product_info_display.php file of your template, you will need to wrap the main product image in a div and float it left, and then wrap the remaining items that you want to appear in the right column in another div, also floated left.

<div id="prodInfoLeft"> <!--bof Main Product Image --> ... </div> <div id="prodInfoRight"> <!--bof Product Price--> ... <!--bof Product description --> ... </div> <br class="clearBoth" />

Then your stylesheet add.

#prodInfoLeft {
width: 250px;
float: left;
padding-top: 10px;
}

#prodInfoRight {
width: 300px;
float: left;
}

Adjust the widths to your needs and adjust the padding-top value of the left column until the main product image lines up with the text. Don't forget the clear at the end or you could cause your description to overlap your footer.

5 Mar 2009, 3:23 PM
#4
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,190
Plugin Contributions:
0

Post #4 by haredo

koenvandamme:

Also, I would like for the image and the text to start at the same height (again, see screenshot please).

Ko,
Question 2,
Locate this:
includes/templates/theme079/css/stylesheet_main.css

#productMainImage, #reviewsInfoDefaultProductImage, #productReviewsDefaultProductImage, #reviewWriteMainImage {
line-height:20px;margin-bottom:80px;
margin-right:25px;
margin-top:36px;
text-align:center;
}

delete the highlighted red font above please

includes/templates/theme079/css/stylesheet.css Add the declaration below to the following existing element: a img {border: none;}

a img {border: none;
margin: 0em 1.9em 0em 0em; }

  1. play with the red font above as you like

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

5 Mar 2009, 3:37 PM
#5
koenvandamme avatar

koenvandamme

New Zenner

Join Date:
Feb 2009
Posts:
53
Plugin Contributions:
0

Post #5 by koenvandamme

Thank you both. Your answers were very clear so I managed to figure it out.

Mind if I ask an other question? As you can see on the sceenshot, I added the 'recently viewed' module. However I would like to add some text between the image and the text. Do I also change this in the stylesheet somewhere?

5 Mar 2009, 3:42 PM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,190
Plugin Contributions:
0

Post #6 by haredo

Ko,
I will take a look

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

5 Mar 2009, 3:45 PM
#7
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,190
Plugin Contributions:
0

Post #7 by haredo

Ko,
You are welcome

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

9 Jul 2009, 4:33 AM
#8
len7560 avatar

len7560

New Zenner

Join Date:
May 2005
Location:
Topanga CA
Posts:
58
Plugin Contributions:
0

Post #8 by len7560

pjb923:

This is a problem that I always had with the stock product info page. My solution is to create 2 columns. In the tpl_product_info_display.php file of your template, you will need to wrap the main product image in a div and float it left, and then wrap the remaining items that you want to appear in the right column in another div, also floated left.

<div id="prodInfoLeft"> <!--bof Main Product Image --> ... </div> <div id="prodInfoRight"> <!--bof Product Price--> ... <!--bof Product description --> ... </div> <br class="clearBoth" />

Then your stylesheet add.

#prodInfoLeft {
width: 250px;
float: left;
padding-top: 10px;
}

#prodInfoRight {
width: 300px;
float: left;
}

Adjust the widths to your needs and adjust the padding-top value of the left column until the main product image lines up with the text. Don't forget the clear at the end or you could cause your description to overlap your footer.

This worked so great! Thank you!