My custom controller is loaded.
I want my phtml file to called from the layout.
I have tried as below:
\app\etc\modules\Mymodule_Customerpage.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mymodule_Customerpage>
<active>true</active>
<codePool>community</codePool>
</Mymodule_Customerpage>
</modules>
</config>
\app\code\community\Mymodule\Customerpage\etc\config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mymodule_Customerpage>
<version>1.0.0</version>
</Mymodule_Customerpage>
</modules>
<frontend>
<layout>
<updates>
<mymodule_customerpage module="Mymodule_Customerpage">
<file>mymodule_customerpage.xml</file>
</mymodule_customerpage>
</updates>
</layout>
<routers>
<mymodule_customerpage>
<use>standard</use>
<args>
<module>Mymodule_Customerpage</module>
<frontName>mymodule_customerpage</frontName>
</args>
</mymodule_customerpage>
</routers>
</frontend>
<global>
<helpers>
<mymodule_customerpage>
<class>Mymodule_Customerpage_Helper</class>
</mymodule_customerpage>
</helpers>
</global>
</config>
\app\design\frontend\base\default\template\mymodule_customerpage.phtml
<layout>
<customer_account>
<reference name="customer_account_navigation">
<action method="addLink">
<name>my_module_section</name>
<path>mymodule_customerpage/index/index</path>
<label>My Module Link</label>
</action>
</reference>
</customer_account>
<mymodule_customerpage_index_index>
<update handle="customer_account" />
<reference name="my.account.wrapper">
<block type="core/template" name="mymodule_customerpage_content" template="mymodule_customerpage.phtml"/>
</reference>
</mymodule_customerpage_index_index>
<!-- <mymodule_customerpage_recipecreation_index>
<reference name="content">
<block type="customerpage/customerpage" name="rec_creation" template="addrecipe/createrecipe.phtml"/>
</reference>
</mymodule_customerpage_recipecreation_index> -->
<mymodule_customerpage_recipeCreation_index>
<reference name="content">
<block type="core/template" name="rec_creation" template="addrecipe/createrecipe.phtml"/>
</reference>
</mymodule_customerpage_recipeCreation_index>
<!-- <default>
<reference name="rec_creation_page">
<block type="core/template" name="rec_creation" template="createrecipe.phtml"/>
</reference>
</default> -->
</layout>
app\design\frontend\base\default\template\mymodule_customerpage.phtml
<?php
<div class="dashboard">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div class="box-account box-info">
<div class="box-head">
<h2><?php echo $this->__('Manage My Recipes') ?></h2>
</div>
</div>
</div>
<div class="page-title">
<form action="<?php echo $this->getUrl('mymodule_customerpage/recipeCreation/index') ?>" method="post" id="form-validate" autocomplete="off">
<button type="submit" class="button" title="<?php echo $this->__('Add New Recipe') ?>">
<span><span><?php echo $this->__('Add New Recipe') ?></span></span>
</button>
</form>
</div>
app\code\community\Mymodule\Customerpage\controllers\RecipeCreationController.php
class Mymodule_Customerpage_RecipeCreationController extends Mage_Core_Controller_Front_Action {
public function preDispatch()
{
parent::preDispatch();
$action = $this->getRequest()->getActionName();
$loginUrl = Mage::helper('customer')->getLoginUrl();
if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
}
}
public function indexAction()
{
echo 'rec cre controller';
$this->loadLayout();
$this->renderLayout();
}
}
here when i click on Add new recipe button...
My controller mymodule_customerpage/recipeCreation/index/ is loading with blank page, which should call my phtml
Have placed phtml both in these locations and tried:
\app\design\frontend\default\default\template\addrecipe\createrecipe.phtml
\app\design\frontend\base\default\template\addrecipe\createrecipe.phtml
<?php
<div>
<?php echo 'Create'; ?>
</div>