Jump to content

Feature product content not arrange as I want


Recommended Posts

Hi,

My website www.uapone.com in the feature product content before it has 3 column shows 3 product a line, but I don't know why recently it changes to 2 with a lot of space left. Even I change the number of products displayed in my Featured Product on the homepage with random mode modules, if still do the same.

How do I arrange them?

 

Thanks

Link to comment
Share on other sites

Hi,

 

I am also interested in this since doing an upgrade has messed with my featured products.

 

I have done a search for the div code but cant find a single file in 1.5 that has that line.

 

I had a look in the homefeatured.css & homefeatured.tpl files but again can't find a place to set the relevant width.

 

Many Thanks

Link to comment
Share on other sites

Hi Marty,

No, once I change the nbItemsPerLine value to any other number all the content in that main area disappear, no images, no feature products. And the weird thing is even I changed the nbItemsPerLine vaule back to 4, the content still not showing up. I have to use the backup file to replace the one I've changed to get everything back. :wacko:

Is there any other way to fix my problem?

 

Thank you

Link to comment
Share on other sites

Hey, I found out something might related to the problem. I use Inspect Element to check the code in Featured Product content. At the forth item it shows <li class ="ajax_block_product item last_item_of_line"> and the next one shows <li class="ajax_block_product clear> I think that's why the 2nd row only shows one item.

 

How and where should I change it in homefeatured.tpl?

 

Here's the code:

 

{foreach from=$products item=product name=homeFeaturedProducts}<br />

<li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}clear{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}"><br />

<h5><a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}</a></h5><br />

<div class="product_desc"><a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}</a></div><br />

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /></a><br />

<div><br />

 

 

Many thanks

Link to comment
Share on other sites

Uapone,

 

I got my issue fixed. I had to add some additional style tags with set widths and heights in to eliminate issues.

 

Set the number of products in the code as listed below.

 

In homefeatured.tpl, At the line beginning width <li - add a style tag (style="width:(width in px);") (without the brackets).

 

Then I had to add some additional height tags in the product description and the H5 tags in the same file as I noticed it moved everything around. I also added a margin-right tag in the li style listed above in order to space to products a little bit otherwise they sat right next to each other. If you give me a little while I'll post my new code with highlights so you can see the changes I made.

Edited by felixstoweit (see edit history)
Link to comment
Share on other sites

No, once I change the nbItemsPerLine value to any other number all the content in that main area disappear, no images, no feature products. And the weird thing is even I changed the nbItemsPerLine vaule back to 4, the content still not showing up. I have to use the backup file to replace the one I've changed to get everything back. :wacko:

Is there any other way to fix my problem?

 

Hi uapone,

 

I just ran a few tests on a fresh install of 1.5 and everything went well. Not sure why this will not work for you but here is exactly what I did.....

 

In modules/homefeatured/homefeatured.tpl I changed

 

{assign var='nbItemsPerLine' value=3}

 

Then in homefeatured.css I changed the width of the li as follows

#featured-products_block_center li {
   height: 240px;
   margin-right: 10px;
   padding: 10px 0;
   width: 171px;
}

 

I have perfect rows of 3 nicely spaced.

 

@felixstoweit -- Don't make something simple so complicated ;)

 

Marty Shue

Link to comment
Share on other sites

  • 4 months later...
×
×
  • Create New...