I am trying to create product block on home page where in I copied page.xml to my theme's layout folder and modified it like
<page_two_columns_left translate="label">
<label>All Two-Column Layout Pages (Left Column)</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
<!-- Mark root page block that template is applied -->
<action method="setIsHandle"><applied>1</applied></action>
</reference>
<reference name="content">
<block type="core/template" name="mycategories" output="toHtml" template="sweet/sweet.phtml"/>
</reference>
Here I was expecting one one block in the middle of my Home page and i am getting that but in addition to this i am getting one more block (same as this block sweet.phtml) at the bottom of home page.. below the footer link. Can anyone tell me whats the problem.
You've marked your block as an output block. When the view is rendered via
renderView()
in the controller action, your block is both a child of a block which echoes its children (content is acore/text_list
block), as well as being an output block which will be rendered in its own right.Remove the
output="toHtml"
bit and you will have what you need. By the way, you could / should move this change from a custom page.xml and into a local.xml file in your layout - it need only be inside a<page_two_columns_left />
layout update handle.