How can I insert custom block into the Home Page using custom layout.xml ?
2 Answers 2
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>
answered Sep 11, 2017 at 8:29
Jaimin Sutariya
11.2k6 gold badges38 silver badges72 bronze badges
-
1Works beautifully :)Rob D. A.– Rob D. A.2017年09月11日 08:42:33 +00:00Commented Sep 11, 2017 at 8:42
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>
answered Sep 11, 2017 at 8:31
-
I would love to give you both some extra points unfortunately Jaimin was first, Upvote anyway :) thank you ;)Rob D. A.– Rob D. A.2017年09月11日 08:43:27 +00:00Commented Sep 11, 2017 at 8:43
default