Display Custom Static .phtml page from CMS backend In Magento



Sometime we want to load our custom .phtml page in Magento. In this post I am trying to describe how to load/display your custom .phtml file in Maganto through the CMS backend. It is very easy and you can do it by following the steps given below:

Step 1. First of all create your custom .phtml file and put it under the folder, Suppose I have created a file named as operation.phtml and uploaded it into the app/design/frontend/default/your_custom_template/template/catalog/product folder.

Step 2. Now Login to the Magento admin panel and create the Static page for creating the Static Page Navigate to the CMS –> Pages and clicks on to the “Add New Page” Button (On top right of the Grid). Read more Display products on homepage from the specific category in Magento

Step 3. Fill all the required fields and clicks on the Content Tab from the Left Navigation and paste the following code:

{{block type="catalog/product_operation" name="product_operation" as="product_operation" template="catalog/product/operation.phtml"}}

Note : Replace your operation.phtml file name and path from our file name/path.

Step 4. You can load the page through the Design Block as well for this clicks on to the Design tab from the left Menu and paste the following code into the “Layout Update XML” fields:

<reference name="content">
    <block type="catalog/product_operation" name="home" template="catalog/product/operation.phtml"></block>
</reference> 

You can also call the left and right navigation from here as well

<reference name="left">
	<block type="catalog/navigation" name="leftnav" template="catalog/navigation/left.phtml"/>
</reference> 

Step 5. If you want to load your custom page with the left navigation then use the code below means just Paste the code into the “Layout Update XML” fields:

<reference name="left">
	<block type="catalog/navigation" name="leftnav" template="catalog/navigation/left.phtml"/>
</reference> 
<reference name="content">
    <block type="catalog/product_operation" name="home" template="catalog/product/operation.phtml"></block>
</reference> 

Now refresh the Magento Cache and Refresh your browser cache as well to see the changes.

You have done, Enjoy and Happy coding in Magento.