15

What is the Handler? Can someone explain the below code?

<update handle="customer_account"/>

or same code like above for example :

<update handle="default"/>

and how it worked !?

2 Answers 2

16

Each page on a Magento website has a handle. That handle equates to a layout XML file. For example, <update handle="customer_account"/> indicates to Magento’s layout system that it should take into account any directives contained within the customer_account.xml file. This particular file is used commonly amongst the various pages within the customer’s account in the secure, logged in area.

default.xml provides layout updates common to all pages on the site.

So, to tie it all together, the customer’s account pages use at minimum the default.xml and customer_account.xml file to determine the layout of those pages.

The handle translates to a layout XML file.

3
  • hi @Shawn, still not cleared, I am loading custom sidebar menu in account dashboard, there also i used update handle, but not finding the reason behind it. Commented Dec 19, 2018 at 7:33
  • 1
    @jafarpinjar this sounds like something to be addressed in a new post Commented Dec 19, 2018 at 8:06
  • That's fine, I wanted to know the main objective of using <update handle ? Commented Dec 24, 2018 at 11:46
10

Update is used to include a certain layout xml file.

The handle declared in the tag is included.

Shared in Link

You can check about layout handles here

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.