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
2010-06-21 08:46:14
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
2010-06-21 08:52:49
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
2010-06-21 09:13:07