Jump to content

Product Image Rows


Guest annaylee

Recommended Posts

Guest annaylee

How do you make several rows of products? For some reason my products are lining up across 1 long row instead of 4 images on 1 row.....and then another 4 on second row......etc....

Can someone help me resolve this?

Link to comment
Share on other sites

If your problem is in Latest Products, here's a fix:

In the includes/content/index.inc.php find this line:

for($i=0;$i<count($latestProducts);$i++){

Replace with this code

$across=4;

$index->assign("TW",100/$across);

for($i=0;$i<count($latestProducts);$i++){

if (!(($i+1) % $across)) {

$index->assign("TXT_TR","</tr><tr>");

} else {

$index->assign("TXT_TR","");

}

in skins/{insert skin name}/styleTemplates/content/index.tpl replace all code

between

<!-- BEGIN: repeat_prods -->

and

CODE

<!-- END: repeat_prods -->

including those two lines above with this code

CODE

<table width="100%" border="0"><tr>

<!-- BEGIN: repeat_prods -->

<td width="{TW}%">

<div style="float: center; text-align: center;">

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

<br />

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

</td>

{TXT_TR}

<!-- END: repeat_prods -->

</tr></table>

The $across variable is used to specify number products across.

Link to comment
Share on other sites

Guest annaylee

THANK YOU!!!! it worked!

If your problem is in Latest Products, here's a fix:

In the includes/content/index.inc.php find this line:

for($i=0;$i<count($latestProducts);$i++){

Replace with this code

$across=4;

$index->assign("TW",100/$across);

for($i=0;$i<count($latestProducts);$i++){

if (!(($i+1) % $across)) {

$index->assign("TXT_TR","</tr><tr>");

} else {

$index->assign("TXT_TR","");

}

in skins/{insert skin name}/styleTemplates/content/index.tpl replace all code

between

<!-- BEGIN: repeat_prods -->

and

CODE

<!-- END: repeat_prods -->

including those two lines above with this code

CODE

<table width="100%" border="0"><tr>

<!-- BEGIN: repeat_prods -->

<td width="{TW}%">

<div style="float: center; text-align: center;">

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

<br />

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

</td>

{TXT_TR}

<!-- END: repeat_prods -->

</tr></table>

The $across variable is used to specify number products across.

Link to comment
Share on other sites

  • 1 month later...

i replaced the code also but now my imgages in latest priduucts are shown with no space between the images

you can see it here www.byxanthe.com

All done, found it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...