I registered a new action that should receive POST and return JSON encoded data to my javascript, I don't need any blocks such as header, footer, etc, so I tried to do the empty page this way in my layout xml:

    <reference name="root">
        <remove name="head "/>

I believe there should be some more elegant workaround for this purpose ?

ps. If I understood correctly, magento REST API is to deal with magento as admin ?

     (Mage::app()->getStore()->isAdmin() === true)

please correct me if i wrong, any good link for creating rest apis like this would be much appreciated. Thank you!

1 Answer 1


I think you can use this code below in your layout file:

    <remove name="head"/>
    <remove name="content"/>
    <reference name="root">
        <action method="setTemplate"><template>page/empty.phtml</template></action>
  • thank you for reply, i have tried this and still had this sidebars and other stuff showing up. another thing is to overwrite block constructor and do the stuff there but looking for more elegant solution, if avaliable...
    – Ilja
    Nov 19, 2015 at 14:21
  • You can add 2 tag <remove name="head"/> <remove name="content"/> and try again
    – LinoPham
    Nov 19, 2015 at 14:28

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.