0

How can I insert custom block into the Home Page using custom layout.xml ?

asked Sep 11, 2017 at 8:24

2 Answers 2

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
1
  • 1
    Works beautifully :) Commented Sep 11, 2017 at 8:42
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>
answered Sep 11, 2017 at 8:31
1
  • 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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.