The Magento Layout.xml <remove ...> tag does not have the desired effect.
I have an auth-redirect module that is at the beginning of all page layout files (1column, 2column, etc.). This works to make sure that before rendering any page, if the user is not authenticated correctly, he will be redirected to the login page.
The way I enable visualization of the login page in the customer.xml file, declare the following:
<customer_account_login> <remove name="auth-redirect"/> ... </customer_account_login> It works fabulously.
However, I recently created an add-on module for a module, and when I go to the URLs that use this module controller and display the layout of the modules, auth-redirect stays on the page and therefore I am always redirected.
The layout of the custom module is as follows:
<shipment_management_index> <remove name="auth-redirect"/> <reference name="content"> <block type="custom/vendor_shipment_info" template="custom/vendor/shipment/info.phtml" name="info"/> </reference> </shipment_management_index> Now I went to the page and using the Alan Storm module showLayout got the output from: showLayout = page. You can see that the element for auth-redirect is on the page, below the body, but at the top, the redirection is still on the page. What am I missing?
<layout><block name="formkey" type="core/template" template="core/formkey.phtml"/> <block type="page/html" name="root" output="toHtml" template="page/1column.phtml"> <block type="page/html" name="auth-redirect" as="auth-redirect" template="page/html/auth-redirect.phtml" ignore="1"/> <block type="page/html_head" name="head" as="head"> ... </block> ... <remove name="auth-redirect"/> <reference name="content"> <block type="custom/vendor_shipment_info" template="custom/vendor/shipment/info.phtml" name="info"/> </reference> </reference></layout> Is your last code snippet in the same file? If yes, why not try to comment / delete first
<block type="page/html" name="auth-redirect" as="auth-redirect" template="page/html/auth-redirect.phtml" ignore="1"/> If not, perhaps the code below will work if the "auth-redirect" block that you want to remove is nested in the "formkey" block.
<reference name="formkey"> <action method="unsetChild"><name>auth-redirect</name></action> </reference>