0
votes

In my site home page, I have three blocks like Recommend product,Top ten product and Talking about product, All products are coming properly by their attribute name.For this, I create three attribute in admin section and add layout design in home page in admin section and add block type in page.xml and i call this blocks by their name in 2column-left.phtml

 echo $this->getChilidHtml("block_names")

But,My problem is when i click on any product it will redirect to product details page that is catlog/product/view.phtml, on this page i want to add two different blocks as like home page ,I found its xml page also , I think that is catalog.xml on this page make changes in side the content reference and it is coming ,but i want to add a new block as line content , i was trying but i am not getting any idea please any solution for this.

<catalog_category_layered>
<reference name="recommend">
        <block type="catalog/product_list" name="catalog.product_list" as="recommend_list" template="catalog/product/view/recommend.phtml">
        </block>
    </reference>
</catalog_category_layered>

I add above line code in catalog.xml as a new block and call it in view.phtml as echo $this->getChildHtml('recommend') but it is not showing,I am sure this approach is wrong one .

any solution for this how can i call.

Thanks & Regards

1
Please, don't try to add code in comments. If you have to add code... and I don't mean a ton but the minimal required to illustrate your issue, then edit your question.user1228

1 Answers

0
votes

Try this,In your catalog.xml

   <catalog_product_view translate="label">// find this line 

    <reference name="content">
     ..............

     <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

      <block type="catalog/product_list" name="catalog.product_list" as="recommend_list" template="catalog/product/view/recommend.phtml"/> //add your block into product.info block


     .............

     </block>
</reference>
    ................

    </catalog_product_view>

call the your block using name in in catalog/product/view.phtml

echo $this->getChildHtml('recommend_list')

Hope this helps