0

This is the url ....customer/address/new/. This is the code from the layout:

<customer_address_new>
        <reference name="root"> 
           <block type="core/template" name="headertext" template="customer/address/header_address.phtml" />
        </reference>
</customer_address_new>

This is a code from 2column-left.phtml

<?php echo $this->getChildHtml('headertext')
    $request = $this->getRequest();
    $module = $request->getModuleName();
    $controller = $request->getControllerName();
    $action = $request->getActionName();
?>

The result of a var_dump for $module is : customer

The result of a var_dump for $controller is : address

The result of a var_dump for $action is : form

I tried every combination of creating my xml. These are the combination

<customer_address_new>
<customer_address_form>
<customer_address_index>

neither of them are not working. What am I missing ?

  • What block are you trying to create on this page? – rob3000 Aug 19 '15 at 4:35
  • 2
    Also add this Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles()); to your 2column-left.phtml this will give you the layout handles that are being used – rob3000 Aug 19 '15 at 4:41
  • It shows me this: <customer_address_form>. But still doesn't work – Attila Naghi Aug 19 '15 at 6:57
  • If I change the template path it works. Weird. Can you help me with this ?:) – Attila Naghi Aug 19 '15 at 7:01
1

Ok From what i understand you only want your block to appear on the url customer/address/new/ You should be able to add your block in your local.xml via the following:

<customer_address_form>
    <reference name="content">
        <block type="core/template" name="headertext" before="-" template="customer/address/header_address.phtml" />
    </reference>
</customer_address_form>

Notice on the block i have the attribute before="-" this basically states that we want this block to be before all others.

In the template customer/address/header_address.phtml i have just added the following text: HELLO THIS IS MY BLOCK!.

You should get the following output:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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