i want to put Send Email link in left side of the page. when i press on it, it should be linked with email.phtml page.

i tried 2 or 3 different ways but it not works.

i put below code in mytheme/layout/xyz.xml

<reference name="left">
     <block type="page/template_links" name="policy_contents" as="policy_contents"      template="page/template/links.phtml">
        <action method="addLink" translate="label title">
        <label>Our Commitment To Privacy</label>
        <title>Jump To This Section</title>

above code works mean through which links display. but when i replace block type, template

and other detail which is related mydata it not works.

so, what should i put exact inside .php and .phtml file???



2 Answers 2



<?xml version="1.0"?>

<!-- ... -->
            <!-- the <example> tagname appears to be arbitrary, but by
            convention is should match the frontName tag below-->
                <example module="example">
                <class>Xyz_Example_Block</class>  <!-- Path of the
 Block Folder, where all php files are located related to view -->


<?xml version="1.0" encoding="UTF-8"?>

<layout version="0.1.0">
        <reference name="left">
        <block type="example/email" name="Email" as="Email" template="example/email/email.phtml">

    <reference name="content">
        <block type="example/example" template="example/email1.phtml"/>


<a href="<?php echo $this->getBaseUrl().'example/index/';?>">Send Email</a>


class Xyz_Example_IndexController extends Mage_Core_Controller_Front_Action
    public function indexAction()

What i understand from question is that you have placed the link but you are not getting how to create a url and render your phtml file on that url.

First of all you need to clear scope of the work according to which you should make a custom module which will provide you the url . Now this url you should use as the link. In your module create a controller and put all your functionality part in it's actions. Use phtml file after it just to create a view for website user.

You should check how to create custom module in magento. That will definitely help you.

Let me know here if you still can't figure out this. I will give you detailed information and code for this.

  • ya you getting exactly what i want.
    – MageDev
    Commented Jun 28, 2013 at 8:18
  • i know how to create module but problem is that i don't know what should i put in block/*.php and template/*.phtml, as i already created view and controller but i don't know which action need to put inside controller.. Please can you give me demo code???
    – MageDev
    Commented Jun 28, 2013 at 8:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.