Magento Layout.xml<;删除…>;没有预期效果的标签
我在所有页面布局文件(1列、2列等)的开头都有一个“auth redirect”模块。这可以确保在呈现任何页面之前,如果用户未正确验证,则会重定向到登录页面 我允许登录页面呈现的方式是在我的customer.xml文件中,我声明如下:Magento Layout.xml<;删除…>;没有预期效果的标签,layout,magento,Layout,Magento,我在所有页面布局文件(1列、2列等)的开头都有一个“auth redirect”模块。这可以确保在呈现任何页面之前,如果用户未正确验证,则会重定向到登录页面 我允许登录页面呈现的方式是在我的customer.xml文件中,我声明如下: <customer_account_login> <remove name="auth-redirect"/> ... </custome
<customer_account_login>
<remove name="auth-redirect"/>
...
</customer_account_login>
...
这是非常有效的
然而,我最近创建了另一个模块自定义模块,当我转到使用该模块控制器并呈现模块布局的URL时,auth重定向将保留在页面中,因此我总是被重定向
自定义模块布局如下所示:
<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>
现在,我转到页面,使用Alan Storm的showLayout模块从?showLayout=page获得输出。您可以看到auth redirect的元素在页面中,位于主体下方,但在顶部,auth redirect仍然在页面中。我错过了什么
<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>
...
...
您的最后一段代码是否在同一个文件中?如果是,为什么不尝试注释/删除第一个
<block type="page/html" name="auth-redirect" as="auth-redirect" template="page/html/auth-redirect.phtml" ignore="1"/>
如果没有,那么如果要删除的“auth redirect”块嵌套在“formkey”块中,下面的代码可能会起作用
身份验证重定向
<reference name="formkey">
<action method="unsetChild"><name>auth-redirect</name></action>
</reference>