3
votes

I am trying to render the products from a certain category (homepage products) which has the category ID 123 on my homepage.phtml template.

I also want to use a new list template I have created which is located at /app/design/frontend/default/mytemplate/catalog/product/homeproducts.phtml . Its basically a copy of list.phtml but with the toolbar and add to cart buttons removed.

What would I need to add to the phtml file to call the category (123) using the template homeproducts.phtml

1

1 Answers

3
votes

Configuring a Magento Category to be a Homepage

TL;DR: Do it in the Admin at System > Configuration > Web > Default Pages

Screenshot of home page route configuration

Magento uses the URL string to route (dispatch & match) requests to a given action controller class. However, when the URL is

    http://site.com/

There is no information for routing - there are no strings to match. In this case, when the Front Controller dispatches, the request matches the Standard (frontend) router because of its _getDefaultPath() method. This effectively uses a value from the configuration (web/default/front) to match, allowing for a GUI-administered value for your homepage.

By default this value is "cms", aka "cms/index/index", which by default is the CMS page identified by "home".

You can change this string to whatever you like. Setting this value to "catalog/category/view/id/10" for the sample data would make your homepage by the "Furniture" category.

SEO NB: You will need to handle duplicate content issues. Enabling canonical URLs for categories may help.