0

How do I add a static CMS block to the customer logout page? I have it somewhat working, but the content of my CMS block shows twice:

  1. I setup a CMS block called logout_message with a bit of html in there.

  2. Added this to my local.xml

    <label>Customer Account Logout Success</label>
    <remove name="right"/>
    <remove name="left"/>
    <reference name="root">
     <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
     <block type="core/template" name="customer_logout" template="customer/logout.phtml">
     <block type="cms/block" name="logout_message" as="logout_message">
     <action method="setBlockId"><block_id>logout_message</block_id></action>
     </block>
     </block>
    </reference>
    
  3. created my template/customer/logout.phtml:

    <div class="small-16 columns panel-fill ">
     <?php echo $this->getChildHtml('logout_message') ?>
    </div>
    

As I said the content of the static block shows twice - why? Small update - it actually outputs the content of the entire logout.phtml file, not just the CMS block.

asked Sep 14, 2015 at 15:22

1 Answer 1

1

You're basically re-inserting a customer_logout block in the content of the page.

Instead, it should be:

<reference name="customer_logout"> 
 <block type="cms/block" name="logout_message" as="logout_message">
 <action method="setBlockId"><block_id>logout_message</block_id></action>
 </block>
</reference>
answered Sep 14, 2015 at 15:44
2
  • This does work if I place it in side the content reference - but not on it's own. Where did you get the customer_logout reference from? Trying to "find" this stuff is irritating. Commented Sep 14, 2015 at 15:53
  • It's the "name" of the block you want to add/remove stuff to. If you check page.xml, you will see that all the structural blocks are defined there. So when you do a reference to head or content, you are actually referencing a block. Just like your example. Commented Sep 15, 2015 at 9:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.