Trying to add static block to customer logout page, block is displaying twice
-
13-12-2019 - |
Question
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.
Solution
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>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange