uapone Posted October 1, 2012 Share Posted October 1, 2012 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 More sharing options...
Carolina Custom Designs Posted October 1, 2012 Share Posted October 1, 2012 To get the Featured items 3 on a row you just need to change the width of div#featured-products_block_center ul li to width:224px; Hope that helps! Marty Shue Link to comment Share on other sites More sharing options...
felixstoweit Posted October 2, 2012 Share Posted October 2, 2012 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 More sharing options...
uapone Posted October 2, 2012 Author Share Posted October 2, 2012 Hi, Thank you Marty, I changed the width it does fit 3 product a row now but come out another problem, the second row only display 1 product then the 3 row display 3 products again. Any solution? Thanks Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted October 2, 2012 Share Posted October 2, 2012 Ok Here is what you need to do then -- open modules/homefeatured/homefeatured.tpl then find the following around line 32 {assign var='nbItemsPerLine' value=4} Change the value to 3......like so {assign var='nbItemsPerLine' value=3} Hopefully that will solve your problem. Marty Shue Link to comment Share on other sites More sharing options...
jimmykoo Posted October 3, 2012 Share Posted October 3, 2012 Figure out the issues....Thanks for the info Link to comment Share on other sites More sharing options...
uapone Posted October 3, 2012 Author Share Posted October 3, 2012 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. Is there any other way to fix my problem? Thank you Link to comment Share on other sites More sharing options...
uapone Posted October 3, 2012 Author Share Posted October 3, 2012 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 More sharing options...
felixstoweit Posted October 3, 2012 Share Posted October 3, 2012 (edited) 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 October 3, 2012 by felixstoweit (see edit history) Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted October 3, 2012 Share Posted October 3, 2012 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. 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 More sharing options...
Berlindoor Posted February 20, 2013 Share Posted February 20, 2013 The "nbItemsPerLine value=4" JUST moves the last_item class around: so if you set it on 3, the third element will have the last_item class. But if you don't style the css you will end up with the same layout Link to comment Share on other sites More sharing options...
Recommended Posts