I am trying to show newsletter block in the footer, except for the Homepage where I want to show it only in content area.
I used local.xml to move newsletter from left to footer:
<reference name="left">
 <remove name="left.newsletter"/><!-- Moved newsletter to the footer -->
</reference>
Then:
<reference name="footer">
 <!-- Move newsletter to the footer -->
 <block type="newsletter/subscribe" name="newsletter" as="newsletter" template="newsletter/subscribe.phtml"/>
</reference>
Easy, we have it in the footer. My problem is when showing it in homepage content. I used:
<cms_index_index>
 <reference name="content">
 <block type="newsletter/subscribe" name="my.newsletter" as="my.newsletter" template="newsletter/subscribe.phtml" before="-">
 <action method="setElementClass">
 <value>someclass</value>
 </action>
 </block>
 </reference> 
</cms_index_index>
This shows fine the block in content area. However to remove newsletter in the homepage footer I used within CMS page, design, layout update:
<reference name="footer">
 <remove name="newsletter"/>
</reference>
And also tried adding it in local.xml under cms_index_index
But it either shows twice in homepage (content and footer) or only in content, and not showing in any other page (in footer).
Is it related with caching? Am I using it wrong?
- 
 As a side note, make sure you know the difference between removing and unsetting blocks.nevvermind– nevvermind2014年04月15日 12:53:39 +00:00Commented Apr 15, 2014 at 12:53
- 
 If your problem was solved, please select one of the answers as "accepted" to mark this question as solved. magento.stackexchange.com/help/accepted-answerAnna Völkl– Anna Völkl2014年09月10日 19:47:31 +00:00Commented Sep 10, 2014 at 19:47
2 Answers 2
You could do this without calling remove and then having to recreate each block. Simply use the unsetChild and insert actions, they will allow you to move blocks around. The following xml should give you your desired results.
<default>
 <reference name="left">
 <action method="unsetChild">
 <name>left.newsletter</name>
 </action>
 </reference>
 <reference name="footer">
 <action method="insert">
 <block>left.newsletter</block>
 </action>
 </reference>
</default>
<cms_index_index>
 <reference name="footer">
 <action method="unsetChild">
 <name>left.newsletter</name>
 </action>
 </reference>
 <reference name="content">
 <action method="insert">
 <block>left.newsletter</block>
 </action>
 </reference>
</cms_index_index>
The footer has always been finicky for me when it comes to cache.
Try refreshing your Blocks HTML Output cache in Admin => System => Cache Management, and the Layouts cache probably wouldn't hurt.
If that doesn't fix it, see if there's an xml overriding it (if you are using a package/theme). If you're in linux, try:
cd app/design/frontend && grep -rl 'my.newsletter' .
That should yield files with that block declaration.
More about theme hierarchy can be found here: http://www.magentocommerce.com/design_guide/articles/working-with-magento-themes