Magento : 移除/移动 newsletter move / add Newsletter subscribe

Add Newsletter subscriber form in footer

 

1. Go to app/design/frontend/default/your_theme/layout/ open newsletter.xml you will see code block like this :

...
<default>

    <!-- Mage_Newsletter -->
    <reference name="left">
         <block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/>
     </reference>

 </default>
...
 

 

2. Add following code there like this :

...
<default>
    
    <!-- Mage_Newsletter -->
    <reference name="footer">
         <block type="newsletter/subscribe" name="footer.newsletter" template="newsletter/subscribe.phtml"/>
     </reference>
     
 </default>
...
 

 

3. Now Go to app/design/frontend/default/your_theme/template/page/html/ and open footer.phtml then add the following code :

<?php echo $this->getChildHtml('footer.newsletter'); ?>
 

 

4. Done.


Add Newsletter subscriber form in header

 

5. Repeat step 1 to open newsletter.xml file.

 

6 . Add following code there like this :

...
<default>
    
    <!-- Mage_Newsletter -->
    <reference name="header">
         <block type="newsletter/subscribe" name="header.newsletter" template="newsletter/subscribe.phtml"/>
     </reference>
     
 </default>
...
 

 

7. Now Go to app/design/frontend/default/your_theme/template/page/html/ and open header.phtml then add the following code :

<?php echo $this->getChildHtml('header.newsletter'); ?>
 

 

8. Done.

 

OR


Add newsletter form using direct call in any block

 

Just copy and paste the following code in any .phtml extention file.

<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>
 

 

Enjoy.

 

 

 

来源:http://jagdeepbanga.com/blog/magento-how-to-move-add-newsletter-subscribe-form-to-footer-header.html

 

 

 

 

 

你可能感兴趣的:(agent)