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 Answer 1

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
5
  • I already use that.. but products is in list mode.. i wnat to be in grid.. Commented Feb 17, 2014 at 11:03
  • Sorry, the mode="grid" get lost Commented Feb 17, 2014 at 11:48
  • Thank you, I try it but it don't work.. :/ Commented Feb 17, 2014 at 11:53
  • updated. 7 more to go... Commented Feb 17, 2014 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.. :/ Commented Feb 18, 2014 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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