0

Okay so I want to be able to put multiple different types of products on my main page. I found this code

{{block type="catalog/product_list" category_id="259"template="catalog/product/list.phtml"}}

It puts the products on the page but the layout is really messed up. I know I could do a bunch of css to fix it but I was hoping there was an easier way to fix it. Here are a couple screen shots to show what it looks like:

enter image description here

enter image description here

I am hoping there is an easy fix or an easier way to get this done. Either would work. Thank You.

And yes I have looked at other issues like this on here but they all mostly seem like an easy css fix that is different than mine.

Update: I edited the width and took out 'clear:left;' in the css to make it fit on the same line. However they are doing a weird indent for each new product. I know i could do a "position: absolute;" and just move each one up however many pxs it takes to be even across, but that just seams like ugly coding. If anyone knows how to get this looking better I would appreciate the help. enter image description here

Final Update: The next day when I opened up the website the weird indent was not there. I do not think I did anything to fix it... But yes like Adarsh and Anshu said, column_count="" controls the amount of products on that line.

1

Try this:

{{block type="catalog/product_list" column_count="4" category_id="8" template="catalog/product/list.phtml"}}

Category id 8 must be replaced by your category id.

Although displaying more than 3 columns in your template would likely require additional CSS/layout changes as well.

PS column_count="4" means your column and which is only available if you have referenced $this→getColumnCount() in your catalog/list.phtml.

Hope this helps.

1

Copy catalog/product/list.phtml to catalog/product/homepageproducts.phtml.
Now modify homepagepageproducts.phtml according to your requirement and need.

column_count is no. of columns in the layout and category_id is from which category products are taken.

{{block type="catalog/product_list" category_id="259" column_count="3" template="catalog/product/homepageproducts.phtml"}}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.