Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding Newest/featured Product to my custom home page
 
GrinIV
Jr. Member
 
Total Posts:  6
Joined:  2010-03-11
 

I’m still trying to get the hang of all this but I’ve run into quite a pickle with this one.

I’ve got a custom home page that I’ve created that I want to add in a “Featured Product” block that displays 1 product on the front page. Here’s what I have for the code:

Magento 1.3.2.4

On my 1column-home.phtml:

<div class="newProduct">
                    
<?php echo $this->getChildHtml('newProduct'?>
        
</div>

In my page.xml:

<default>
        <
block type="page/html" name="root" output="toHtml" template="page/1column-home.phtml">....
            <
block type="core/text_list" name="newProduct" as="newProduct"/>
....</
block>
</default>

In my catalog.xml:

<default>....
        <
reference name="newProduct">
            <
block type="catalog/product_new_index"  name="home.product.new"  template="catalog/product/new.phtml"  />
        </
reference>
....</default>

Is this the correct way to do this? I’ve gotten an error before from a change in the catalog so it seems like it’s reading it correctly, but it’s not spitting out the code from the new.phtml(which is just the default new products code). Also a big help would be how to modify it so it only displays one product, though first I’d just love for it to even anything at all.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top