I'm trying to figure out why Magento is not highlighting my new customer account link when I access the corresponding page. Here is my code :

<?xml version="1.0"?>
<layout version="0.1.0">
          <reference name="content">
    <customer_account translate="label">
        <reference name="customer_account_navigation">
            <action method="addLink"><name>Mes parrainages</name><path>mesparrainages/index/index/</path><label>Mes parrainages</label></action>
        <update handle="customer_account"/>
           <reference name="my.account.wrapper">
                <block type="parrainage/mesparrainagesblock" name="bloc_mesparrainages" as="bloc_mesparrainages" template="parrainage/mesparrainages.phtml" />

I'm using CE 1.9, maybe they changed the way it works.. Somebody have an idea please ?

Edit: Here is my config.xml:

<?xml version="1.0"?>
            <email_parrainage module="parrainage">
                <label>Email parrainage</label>
      <customer_register_success> <!-- identifier of the event we want to catch -->
          <customer_register_success_handler> <!-- identifier of the event handler -->
            <type>singleton</type> <!-- class method call type; valid are model, object and singleton -->
            <class>parrainage/observer</class> <!-- observers class alias -->
            <method>registerCustomerObserve</method>  <!-- observer's method to be called -->
            <args></args> <!-- additional arguments passed to observer -->

Here is my template :

<div class="dashboard">
    <div class="page-title">
        <h1><?php echo $this->__('Mes parrainages'); ?></h1>
    <form action="<?php echo Mage::getUrl('mesparrainages/index/addfilleul/'); ?>" method="post" autocomplete="off" id="form-validate" class="scaffold-form" enctype="multipart/form-data">
    <input type="hidden" name="parrain_customer_id" value="<?php echo Mage::getSingleton('customer/session')->getCustomer()->getId(); ?>">
    <div class="fieldset">
        <h2 class="legend">Ajouter un filleul</h2>
        <ul class="form-list">
                <label for="email" class="required">Adresse email</label>
                <div class="input-box">
                    <input type="email" autocomplete="off" autocapitalize="off" autocorrect="off" spellcheck="false" name="email_filleul" id="email" title="Adresse email" class="input-text required-entry validate-email">
                    <button type="submit" title="Enregistrer" class="button"><span><span>Ajouter filleul</span></span></button>
    <table class="data-table">
        <col />
        <col width="160" />
        <col width="120" />
        <col width="60" />
                <th><?php echo $this->__('Email du filleul') ?></th>
                <th><?php echo $this->__('Statut') ?></th>
                <th><?php echo $this->__('Code promo') ?></th>
        <?php $filleuls = $this->getFilleuls(); 
            if($filleuls){ ?>
                <tbody id="filleuls">
                <?php foreach($filleuls as $filleul): ?>
                        <td><?php echo $filleul->getEmailFilleul(); ?></td>
                        <td><?php echo $this->getStatut($filleul); ?></td>
                        <td><button id="resend" data-email="<?php echo $filleul->getEmailFilleul(); ?>" type="submit" title="Renvoyer" class="button"><span><span>Renvoyez l'email</span></span></button></td>
                <?php endforeach ?>
            <?php }else{ ?>
                        <td colspan = "4">Vous n'avez pas encore de filleuls !</td>
            <?php } ?>

<script src="//code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
        if($(this).text()=="Renvoyez l'email"){
            var email = $(this).data("email");
                url: "<?php echo Mage::getUrl('mesparrainages/index/sendemail/'); ?>",
                type: "POST",
                data: { email : email },
                context: this,
                    $(this).text("Email envoyé !");
        var email = $(this).find('#email').val();
            url: "<?php echo Mage::getUrl('mesparrainages/index/addfilleul/'); ?>",
            type: "POST",
            data: $(this).serialize(),
            context: this,
                $("#filleuls").prepend("<tr><td>"+email+"</td><td>Pas encore inscrit</td><td>Aucun</td><td><button id='resend' type='submit' title='Renvoyer' class='button'><span><span>Email envoyé !</span></span></button></td></tr>");
            error:function(xhr, status, error){
  • provide template.phtml file and config.xml file of your module Aug 14, 2014 at 4:01
  • @programmer_rkt I edited the first post ;) Aug 14, 2014 at 4:32
  • show your full config.xml and template.phtml Aug 14, 2014 at 5:26
  • @programmer_rkt okey ;) sorry for that but i'm french, and i'm too tired to change all the names, i just did not sleep at all tonight Aug 14, 2014 at 5:29
  • my.account.wrapper is this block is already existing one ? Aug 14, 2014 at 5:35

1 Answer 1


Your block definition is wrong here

<block type="modulename/blockname" name="block_name" template="template.phtml" />

As per your module configuration it should look like

<block type="parrainage/blockname" name="block_name" as="block_name" template="template.phtml" />

since parrainage is the alias for your module's block. But in order to ensure this block render its content, you may also need to look on this

1. You should have block defined in backend

Location : app/code/local/Motion4Ever/Parrainage/Block/Blockname.php

class Motion4Ever_Parrainage_Block_Blockname extends Mage_Core_Block_Template {


Without defining this block class, Magento would not understand which block that you are referencing in layout file

2. You need to ensure the parent block is defined before referencing the block.

In this case, this step won't be necessary. Since it is defined in customer.xml

  • This isn't solving my problem.. My block is correctly defined, since it's actually working, only the left hand side highlighting of the menu is not ;) I'm adding my proper layout.xml file Aug 14, 2014 at 6:00

Your Answer

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

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