I am attempting to get my head around the Magento templating system and I’m running into a number of problems.
The first thing that I want to be able to do is on the catalog homepage (not the cms homepage) to display the top-level categories with their images and titles. To start off testing this I cleared the app/design/frontend/default/littlebedroom/template/catalog/home.phtml file and replaced it with the following code:
<?foreach ($this->getStoreCategories(1) as $_category):?>
I have purposefully kept this as simple as possible in order that I can start from the very basics and learn as I increase the functionality. However, even at this stage I am getting errors! When I now go to the catalog homepage I receive the following error (application trace and full path details excluded):
Warning: Invalid argument supplied for foreach() in .../app/design/frontend/default/littlebedroom/template/catalog/home.phtml on line 4
Now, I am assuming that to achieve what I want I will also have to edit the layout/main.xml file in my theme, but I have no idea how this file works!
If anyone could provide some pointers on where I have gone wrong, or what else I need to edit then I would be very extremely grateful. Thanks.