Adding categories and products to the homepage

Post By:user_34108 | Reply

 

Hi everyone,

I want to do something relatively simple, but I can’t for the life of me figure out how to do this. I’ve searched all over Google and these forums but to no avail. I think the problem might be more that I don’t know what to look for rather than the answers not being there.

Here is what I want to achieve:

I have four top level categories with sub categories under each and products group accordingly.

I want to create four sections on the homepage of my site which display these categories and products - sounds simple right?

So far I have managed to get the categories to list out on the page using a reference in the layout XML for page.xml:

<default translate="label" module="page">
        <
label>All Pages</label>

        <
block type="page/html" name="root" output="toHtml" template="page/1column.phtml">

...
            <
block type="core/text_list" name="homepage_content" as="homepage_content"/>
...
</default>

    <
page_one_column translate="label">
        <
label>All One-Column Layout Pages</label>
        <
reference name="root">
            <
action method="setTemplate"><template>page/1column.phtml</template></action>
            <!-- 
Mark root page block that template is applied -->
            <
action method="setIsHandle"><applied>1</applied></action>
        </
reference>
        <
reference name="homepage_content">
            <
block type="catalog/navigation" name="catalog.category" template="catalog/category/homepage_content.phtml">
            </
block>
        </
reference>
    </
page_one_column>

But I have no idea why I have to use core/text_list and catalog/navigation and then further, how I can include sub-blocks which I can then call from homepage_content.phtml.

The problem is that each category section will have a different layout, so I want to build separate templates for each section and call them into homepage_content.phtml using the getChildHtml() method.

The whole way I have done this just seems so dirty to me… but my mind is completely muddled now and I can’t think of how to go about doing this. I’m sure i’m doing it wrong though!

Can anyone let me know the best way to include categories onto the homepage? Or even point me in the right direction?

Any help would be greatly appreciated! smile

Thanks

`Reply Or Comment!
Please LogIn to Reply!