Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Move Newsletter to the right column
 
jrensel
Jr. Member
 
Total Posts:  1
Joined:  2008-09-25
 

Hi!

I have been searching on how to moe the newsletter from left to right column. But nothing have worked out! Do anybody now a simple way to do this.

Second I want the newsletter box shown in main page (front page) . What code do I put in (in the html) to get this done?

Best from joe

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nikunj Joshi
Member
 
Avatar
Total Posts:  59
Joined:  2008-12-05
SR. PHP Developer
 

There is a file subscribe.phtml in newsletter folder.

The path for it is as follows

app\design\frontend\default\default\template\newsletter

and css apply for this file is boxess.css, you can change it as per requirement.

 
Magento Community Magento Community
Magento Community
Magento Community
 
crius
Guru
 
Avatar
Total Posts:  623
Joined:  2007-10-16
Denmark
 

app/design/frontend/default/default/layout/newsletter.xml

<default>

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

 </default>

Change “left” to “right”. If you have a right column on home page, it will also show up there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

What if I want to move the box to the header section where I have my horizontal navigation? What would be the reference name??

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

ok I figured it out. If your curious how to add your newsletter box to the header of your site all you have to do is navigate to:
app>design>frontend>(your_interface)>(your_theme)>template>newsletter>subscribe.phtml

Open the subscribe.phtml file to so the code for the box. Copy everything from the top to the bottom:

<div class="box base-mini mini-newsletter">
    <
div class="head">
        <
h4><?php echo $this->__('Newsletter'?><a name="newsletter-box"></a></h4>
    </
div>
    <
form action="<?php echo $this->getUrl('newsletter/subscriber/new') ?>" method="post" id="newsletter-validate-detail">
    <
fieldset class="content">
            <
legend><?php echo $this->__('Newsletter'?></legend>
            <!--
            
<?php if( $message $this->getErrorMessage() ): ?>
                
<class="error"><?php echo $message ?></p>
            
<?php endif; ?>
            <?php 
if( $message $this->getSuccessMessage() ): ?>
                
<class="success"><?php echo $message ?></p>
            
<?php endif; ?>
            
-->
            <
label for="newsletter"><?php echo $this->__('Sign up for our newsletter:'?></label>
            <
input name="email" type="text" id="newsletter" class="required-entry validate-email input-text" />
            <
button type="submit" class="form-button-alt"><span><?php echo $this->__('Subscribe'?></span></button>
    </
fieldset>
</
form>
<
script type="text/javascript">
//<![CDATA[
    
var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
//]]>
</script>
</div>

Next you’ll want to navigate to your header.phtml file which is found in the folder page>html under the newsletter folder:
app>design>frontend>(your_interface)>(your_theme)>template>page>html>header.phtml

Inside here you can paste this code any where really. I choose to do it underneath the shop-access div tag. So my code looks like this:

<div class="header-top-container">
    <
div class="header-top">
        <
h1 id="logo"><a href="<?php echo $this->getUrl('') ?>"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        <
class="no-display"><a href="#main"><strong><?php echo $this->__('Skip to Main Content'?> &raquo;</strong></a></p>
        
<?php echo $this->getChildHtml('topSearch'?>
        
<div class="quick-access">
               
<?php echo $this->getWelcome() ?><br />
            <
div class="shop-access">
                
<?php echo $this->getChildHtml('topLinks'?>
            
</div>
            <
div class="box base-mini mini-newsletter">
                <
div class="head">
                    <
h4><?php echo $this->__('Newsletter'?><a name="newsletter-box"></a></h4>
                </
div>
                <
form action="<?php echo $this->getUrl('newsletter/subscriber/new') ?>" method="post" id="newsletter-validate-detail">
                    <
fieldset class="content">
                        <
legend><?php echo $this->__('Newsletter'?></legend>
                        <!--
                            
<?php if( $message $this->getErrorMessage() ): ?>
                            
<class="error"><?php echo $message ?></p>
                            
<?php endif; ?>
                            <?php 
if( $message $this->getSuccessMessage() ): ?>
                            
<class="success"><?php echo $message ?></p>
                            
<?php endif; ?>
                        
-->
                        <
label for="newsletter"><?php echo $this->__('Sign up for our newsletter:'?></label>
                        <
input name="email" type="text" id="newsletter" class="required-entry validate-email input-text" />
                        <
button type="submit" class="form-button-alt"><span><?php echo $this->__('Subscribe'?></span></button>
                    </
fieldset>
                </
form>
                <
script type="text/javascript">
                
//<![CDATA[
                    
var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
                
//]]>
                
</script>
            
</div>
            
<?php echo $this->getChildHtml('store_language'?>
        
</div>
    </
div>
</
div>
<?php echo $this->getChildHtml('topMenu'?>

Now adding this in there the box will be stretched. This should be able to be fixed in the CSS. I will post again when I figure this out. My guess so far is that the style that will fix this is “box base-mini mini-newsletter”. Unfortunately dreamweaver does not see teh class in the CSS. I’ll post again when I figure the rest out.

- Cole

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

Ok so I have figured out how to control the style/size of the newsletter box.

Navigate to your boxes.css file:
skin>frontend>(your_interface)>(your_theme)>css>boxes.css

Go to line 489 (or search for mini-newsletter), you’ll find the styles for a class called .mini-newsletter:

.mini-newsletter h4 { background-image:url(../images/icon_newspaper.gif); }
.mini-newsletter input.input-text { display:blockmargin:3px 0width:167px}

Below .mini-newsletter input.input-text add in this style:

.mini-newsletter { width200pxfloatright}

This style I had to create to give a width of 200 pixels. This will take the box and shrink it to a more suitable size. The reason I choose 200 because if I do something like 150px the “header” of the newsletter that contains the image and title of the box will be smaller than the main content form area for signing up. So 200 will make it so that it fits correctly.
Next I make it float to the right because I want the box to be hanging in the right side of the header.

Hope this helps some people! I’ll post this also in the how-to wiki area with pictures or something…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

You should be able to follow these steps to place the newsletter into the footer. Instead of opening the Header.phtml file, open footer.phtml and place the code where needed.

As for stopping the newletter from appearing in the left navigation. you’ll want to open up “newsletter.xml” we’ll change the reference name to be blank.

So navigate to:
app>design>frontend>(your_interface)>(your_theme)>layout>newsletter.xml

next you’ll want to make the code look like this:

<default>

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

    </default>

That should make the newsletter stop appearing on the your left/right side columns. If not you may find something in the catalog.xml file located in the layout folder.

- Cole

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

Hi,

I’ve been trying to get my newsletter subscribe box to move into the right hand side of my Home Page. Can this be done through the admin/CMS?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

@MacKniven,
When you say to the right hand side of the home page are you talking about in the header, or in the main content area of your home page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

If you want your Subscribe in the home page you can go about two things. Add it by specifying the block type in the home page CMS or you can create a new Static Block. The easiest way is to just add in the block type into the CMS page, but in some instances creating a new static block would be the best.

To add a block type place this into your CMS:

{{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}}

You may be able to move this around if it locates in an undesired location with your CSS. The next method is a bit harder, and requires some manual work, but never the less it should work.
You can find all the information on this post: http://www.magentocommerce.com/boards/viewthread/9921/

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

Thanks, both solutions worked great for me.  I wanted it in the right hand column of the home page (2 column layout) so I went for the XML option in the other link you gave. Cheers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
furqan
Jr. Member
 
Total Posts:  12
Joined:  2008-05-27
 

Thanks “Cole Geissinger”. The I need to put the newsletter section through CMS page it works great. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
jason_rsc
Jr. Member
 
Total Posts:  16
Joined:  2009-12-07
 

so here is another way to place the newsletter in the header.

open up app/design/frontend/<your_interface>/<your_theme>/layout/newsletter.xml
under default
change the reference name to header
in the block set name="top.newsletter" and as="topNewsletter"
so it should look something like this:

<!--
Default 
layoutloads most of the pages
-->

    <default>

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

    </default>

open up app/design/frontend/<your_interface>/<your_theme>/template/page/html/header.phtml

add this line anywhere in the file
<?php echo $this->getChildHtml('topNewsletter') ?>

it should look something like this:

<div class="header-container">
    <
div class="header">
        <
h1 id="logo" class="logo" title="<?php echo $this->getLogoAlt() ?>" style="background-image:url(<?php echo $this->getLogoSrc() ?>);"><a href="<?php echo $this->getUrl('') ?>"><?php echo $this->getLogoAlt() ?></a></h1>
        <
class="welcome-msg"><?php echo $this->getWelcome()?></p>
        
<?php echo $this->getChildHtml('topLinks'?>
        <?php 
echo $this->getChildHtml('topSearch'?>

        
// this next line adds the newsletter template code
       //  in /template/newsletter/subscribe.phtml 
        
<?php echo $this->getChildHtml('topNewsletter'?> 

        <?php 
echo $this->getChildHtml('store_language'?>
    
</div>
    
<?php echo $this->getChildHtml('topMenu'?>
</div>

and that is it

you can pretty much move anything with this method
the key things to note are the uses of
1. reference name attribute in the module layout file ( xml)
2. the as attribute in the block element inside the reference element
3. the getChildHtml("foo “) call in the template file which grabs the block in the reference by its as attribute

 
Magento Community Magento Community
Magento Community
Magento Community
 
mhunkler
Guru
 
Total Posts:  304
Joined:  2009-05-30
 

I opened

app/design/frontend/default/default/layout/newsletter.xml

and it actually says right already, even though its on the left.... ??? Very Strange…

 
Magento Community Magento Community
Magento Community
Magento Community
 
mhunkler
Guru
 
Total Posts:  304
Joined:  2009-05-30
 

i had to refresh the cache, must have had something to do with me reinstalling magento..

 
Magento Community Magento Community
Magento Community
Magento Community
 
leokempf
Jr. Member
 
Total Posts:  29
Joined:  2010-03-18
 

I followed these instructions to move the newsletter form to my footer… it alerts you if you don’t enter a valid email address, but it does not add the email addresses to the db.  Any ideas?

I left the one in the left column - it works fine.

http://waybasic.nexcess.net/shop.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2