tags:

views:

15

answers:

1

How change layot for xmlhttp request? For example if i need "/about" i see full page, if i request this page with ajax, magento use other layout and get for me oly needed information.

A: 

In your action, you can test the content of the Accept http header to decide whether to return text/html or application/javascript ... and choose the template accordingly.

greg0ire
Its possible do with layout?Like:page.xml<xml_http_request> <reference name="root"> <block name="root"> <block name="content"... </block> </reference><xml_http_request>
Kein
Like this, I don't think so, but you can notice that layout files are associated with areas (frontend, backend). I have already used this for phpunit tests, and it worked pretty well, a call to Mage::getDesign()->setArea('yourarea') would be needed.
greg0ire