2

I am following a tutorial found at http://istockphp.com/magento/adding-custom-page-to-the-customer-account-dashboard/ However I edited some of the files to reference some of the folder names I am using and basically (changing any reference to from istockphp to exormedia). My issue is the custom navigation link is visible in the customers dashboard. However I get a 400 when I click the link.

Wondering if anyone might be able to help me spot the issue. The system.log says

2015-05-19T16:03:48+00:00 ERR (3): Notice: Undefined variable: rownumber in /var/www/html/app/design/frontend/blacknwhite/exormedia/template/customer/account/navigation.phtml on line 55

Below is the code I have:

\app\etc\modules\Exormedia_Downloadspage.xml

 <?xml version="1.0" encoding="utf-8"?>
   <!--step 1: registering the module-->
   <config>
      <modules>
         <Exormedia_Downloadspage>
            <active>true</active>
            <codePool>local</codePool>
        </Exormedia_Downloadspage>
     </modules>
  </config>

\app\code\local\Exormedia\Customerpage\etc\config.xml

 <?xml version="1.0"?>
<config>
    <modules>
        <Exormedia_Downloadspage>
          <version>0.1.0</version>
        </Exormedia_Downloadspage>
    </modules>

    <global>
        <blocks> <!--Block folder-->
            <exormedia>
                <class>Exormedia_Downloadspage_Block</class>
            </exormedia>
        </blocks>
    </global>

    <frontend>
        <routers>
            <exormedia>
                <use>standard</use>
                <args>
                    <module>Exormedia_Downloadspage</module>
                    <frontName>custompage</frontName>
                </args>
            </exormedia>

            <customer>
                <args>
                    <modules>
                        <!--name / before: change existing -->
                        <exormedia before="Mage_Customer">Exormedia_Downloadspage</exormedia>
                    </modules>
                </args>
            </customer>
        </routers>

        <layout>
          <updates>
            <exormedia>

              <file>customer/custompage.xml</file>
            </exormedia>
          </updates>
        </layout>

    </frontend>
</config>

  \app\code\local\Exormedia\Customerpage\controllers\AccountpageController.php

  <?php

  class Exormedia_Downloadspage_AccountpageController extends Mage_Core_Controller_Front_Action {

protected function _getSession() {
    return Mage::getSingleton('customer/session');
   }

public function preDispatch() {
    parent::preDispatch();
        if (!Mage::getSingleton('customer/session')->authenticate($this)) {
            $this->setFlag('', 'no-dispatch', true);
    }
}

public function indexAction() { // landing page
    $this->loadLayout();
    $this->renderLayout();

}

}

\app\code\local\Exormedia\Customerpage\Block\Customer.php

  <?php

        class Exormedia_Downloadspage_Block_Customer extend Mage_Customer_Block_Account_Dashboard  {

        }
 ?>

\app\design\frontend\blacknwhite\exormedia\layout\local.xml

  <layout version="0.1.0">
<!--add link to the customer panel-->
<customer_account>
    <reference name="customer_account_navigation">
        <action method="addLink" translate="label" module="customer">
            <name>custom page</name>
            <!--Customer Block/AccountpageController.php-->
            <path>customer/accountpage/</path>
            <label>Custom Page</label>
        </action>
    </reference>
</customer_account>

</layout>

\app\design\frontend\blacknwhite\exormedia\layout\customer\custompage.xml

 <layout version="0.1.0">

   <customer_accountpage_index translate="label">
       <label>Custom Page</label>
          <reference name="head">
                 <action method="setTitle"><title>Custom Page</title></action> <!--Page Title-->
         </reference>
     <!-- Mage_Customer -->
     <update handle="customer_account"/>
      <reference name="my.account.wrapper">

        <block type="exormedia/customer" name="exormedia" before="-" template="customer/custom_customer_page.phtml"/>
    </reference>
  </customer_accountpage_index>
</layout>

\app\design\frontend\blacknwhite\exormedia\template\customer\custom_customer_page.phtml

 div class="page-title">
    <h1><?php echo $this->__('Customer Custom Page') ?></h1>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
    Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero
    sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
    Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed,
    commodo vitae, ornare sit amet, wisi.
</p>
<p>
    Aenean fermentum, elit eget tincidunt condimentum, eros
    ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis.
    Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna
    eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus,
    metus
</p>
<div class="buttons-set">
    <p class="back-link"><a href="<?php echo $this->getUrl('customer/account/') ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
</div>
<script type="text/javascript">
</script>
2
  • thank you for better formatting the code. Any suggestions on fixing the issue?
    – Jayreis
    May 20, 2015 at 18:58
  • you want to add a link in dashboard and associated phtml.right
    – Pawan
    Nov 3, 2016 at 11:15

0

Your Answer

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

Browse other questions tagged or ask your own question.