1

I create my theme for magento and i can't show products in grid mode on my homepage.

I use this to show all products on my homepage but products is in list mode.

{{block type="catalog/product_list_random" name="product_random" template="catalog/product/list.phtml"}}

Here is my catalog.xml and my list.phtml

Can you tell me what i need more to add for this grid mode?

1

try {{block type="catalog/product_list_random" name="product_random" mode="grid" template="catalog/product/list.phtml"}}

It should work.

Your problem is in view.phtml here:

<?php if($this->getMode()!='grid'): ?>

so what you need is to set $this->getMode() to grid.

If you have a look into the List.php:

public function getMode()
{
    return $this->getChild('toolbar')->getCurrentMode();
}

So you need to pass grid into $toolbar->setData('_current_grid_mode', 'grid') but I have no idea, how to do this.

So I see two possibilities here:

  1. You copy the template and remove the list mode (bad idea)
  2. You change the template the way, so that the grid mode is the default
| improve this answer | |
  • I already use that.. but products is in list mode.. i wnat to be in grid.. – svukovic Feb 17 '14 at 11:03
  • Sorry, the mode="grid" get lost – Fabian Blechschmidt Feb 17 '14 at 11:48
  • Thank you, I try it but it don't work.. :/ – svukovic Feb 17 '14 at 11:53
  • updated. 7 more to go... – Fabian Blechschmidt Feb 17 '14 at 11:58
  • I tried all options and i don't know why i can't do that.. :/ This is my list.phtml jsfiddle.net/XN8LV . I try to delete list view.. and change position.. but nothing.. :/ – svukovic Feb 18 '14 at 9:03

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.