How can I insert custom block into the Home Page using custom layout.xml ?
2 Answers
You can use cms_index_index
tag in your layout.xml file and insert your block in your homepage like below.
<cms_index_index>
<reference name="content">
<block type="mymodule/myblock" name="myblock" template="mytemplate/myphtml.phtml" />
</reference>
</cms_index_index>
-
1
Go to app/design/frontend/{your package}/{your theme}/layout/local.xml
then add this:
<cms_index_index>
<reference name="content">
<block type="core/template" name="my.custom.block" template="path/to/template.phtml" />
</reference>
</cms_index_index>
-
I would love to give you both some extra points unfortunately Jaimin was first, Upvote anyway :) thank you ;) Commented Sep 11, 2017 at 8:43