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:
I setup a CMS block called logout_message with a bit of html in there.
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>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.
1 Answer 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>
-
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.Sean Kimball– Sean Kimball2015年09月14日 15:53:33 +00:00Commented 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 toheadorcontent, you are actually referencing a block. Just like your example.Fran Mayers– Fran Mayers2015年09月15日 09:34:37 +00:00Commented Sep 15, 2015 at 9:34