2010-06-11 2 views
4

모든 페이지 레이아웃 파일 (1 열, 2 열 등)의 시작 부분에 "auth-redirect"모듈이 있습니다. 이렇게하면 페이지를 렌더링하기 전에 사용자가 제대로 인증되지 않은 경우 로그인 페이지로 리디렉션되는지 확인할 수 있습니다. 이것은 엄청나게 작동Magento Layout.xml <remove ...> 태그가 원하는 효과 없음

<customer_account_login>           
    <remove name="auth-redirect"/> 
    ... 
</customer_account_login> 

: 나는 로그인 페이지 렌더링 할 수

방법은 나는 다음과 같은 선언 내 customer.xml 파일에 있습니다.

그러나 최근에 다른 모듈 맞춤 모듈을 만들었고 모듈의 컨트롤러를 사용하고 모듈 레이아웃을 렌더링하는 URL로 이동할 때 auth-redirect가 페이지에 남게되어 항상 리디렉션됩니다.

사용자 정의 모듈 레이아웃은 다음과 같습니다

<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> 

을 지금, 나는 페이지로 사라 앨런 스톰의 showLayout 모듈은 showLayout = 페이지의 출력을 얻었다 사용했다?. 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> 

답변

3

마지막 파일은 같은 파일에 있습니까? 그렇다면 언급을하려하지 왜 /하지 않으면 제거 할 "인증-리디렉션"블록이 "formkey"블록에 중첩되어있는 경우 첫 번째

<block type="page/html" name="auth-redirect" as="auth-redirect" template="page/html/auth-redirect.phtml" ignore="1"/> 

는, 어쩌면 아래의 코드가 작동 삭제합니다.

<reference name="formkey"> 
    <action method="unsetChild"><name>auth-redirect</name></action> 
    </reference> 
관련 문제