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
[SOLVED] Add newsletter block to homepage left column
 
Sipke
Jr. Member
 
Total Posts:  10
Joined:  2008-03-26
 

I am trying to get the newsletter sign up block on the homepage screen, but I’m stuck. I’m struggling with this and don’t know where to start or how to do this. Can anybody explain what to do?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I did this ... but I don’t remember off the top of my head how - I know that I used the default template as a guide though because that’s where it’s located in the default template.

Make sure you refresh your cache - it’s one of those changes you definitely can’t see otherwise.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Ok, these are what my files look like with the newsletter in the left column (http://www.minervapromotions.com/ihsa):

app/design/frontend/default/TEMPLATE/template/newsletter/subscribe.phtml

<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">
    <
label for="newsletter"><?php echo $this->__('Sign up for our newsletter'?>:</label>
    <
div class="input-box">
      <!-- 
Created for the validation error accomodation -->
      <
input name="email" type="text" id="newsletter" value="Enter your email address" class="required-entry validate-email input-text" />
    </
div>
    <
input type="image" src="<?php echo $this->getSkinUrl('images/btn_submit_mini.gif') ?>" value="<?php echo $this->__('Sign me up') ?>"/>
    </
fieldset>
  </
form>
</
div>
<
script type="text/javascript">
<!--
    var 
newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
    new 
Varien.searchForm('newsletter-validate-detail''newsletter''<?php echo $this->helper('newsletter')->__('Enter your email address') ?>');
//-->
</script>

app/design/frontend/default/TEMPLATE/layout/page.xml (This one doesn’t seem right to me, but it’s working.)

<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
                <
block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
                <
block type="newsletter/subscribe" name="newsletter" as="newsletter" template="newsletter/subscribe.phtml"/>
                <
block type="page/template_links" name="footer_links" as="footer_links" template="page/template/footer_links.phtml"/>
            </
block>

skin/frontend/default/TEMPLATE/css/boxes.css

.mini-newsletter .head              { backgroundurl(../images/base-mini-bg.jpgno-repeat}
.mini-newsletter .head h4            { text-alignleft!important}
.mini-newsletter .input-text         { margin:5px 0px 5px 0pxwidth170px}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Sipke
Jr. Member
 
Total Posts:  10
Joined:  2008-03-26
 

I can’t get this working. There should be a easier way to get the newsletter sign-up box on every page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
BoostMyShop
Sr. Member
 
Avatar
Total Posts:  155
Joined:  2008-06-11
France
 
Sipke - 17 June 2008 06:56 PM

I can’t get this working. There should be a easier way to get the newsletter sign-up box on every page?

i agree.
here is an example to move cart box : http://www.magentocommerce.com/design_guide/articles/intro-to-layouts
you should be able to do it editing xml files…

however explanation are not right for me: i understand phtml using but not layout ....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Thejosh13
Sr. Member
 
Total Posts:  252
Joined:  2008-06-23
 

I am also looking to add the Newsletter block to the left column of the homepage, Is there a way to just add it to the CMS Manage Pages?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Thejosh13
Sr. Member
 
Total Posts:  252
Joined:  2008-06-23
 

I cant seem to figure out how to add the right code?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

it really simple.

1. open up newsletter.xml, just change the reference name from ‘left’ to ‘right’, ‘footer’ to ‘header’, or ‘right’ to left

<default>

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

then place it in your template
newsletter sign up for Default theme already is on the left.
Modern theme is placed in the ‘page > html> footer.phtml’. To move it from footer to left, just cut this out ‘ <?php echo $this->getChildHtml('newsletter') ?>’, place it in the temple, something like this, after the ‘left’:

<?php echo $this->getChildHtml('left') ?>
<?php echo $this->getChildHtml('newsletter') ?>

but of course, if you use a one column template for your homepage then it wont’ show up because one column only reference to ‘content’.

 
Magento Community Magento Community
Magento Community
Magento Community
 
craigboi87
Sr. Member
 
Avatar
Total Posts:  90
Joined:  2008-07-18
 

can i ask where the newsletter.xml file is?

 
Magento Community Magento Community
Magento Community
Magento Community
 
validBen
Jr. Member
 
Total Posts:  13
Joined:  2008-10-22
 

all the xml files from a theme are situated in your Magento folder in:

app > design > frontend > default > ThemeName > layout

 
Magento Community Magento Community
Magento Community
Magento Community
 
ctilp
Jr. Member
 
Total Posts:  16
Joined:  2008-03-31
 
chinesedream - 01 August 2008 06:16 PM

it really simple.

1. open up newsletter.xml, just change the reference name from ‘left’ to ‘right’, ‘footer’ to ‘header’, or ‘right’ to left

<default>

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

then place it in your template
newsletter sign up for Default theme already is on the left.
Modern theme is placed in the ‘page > html> footer.phtml’. To move it from footer to left, just cut this out ‘ <?php echo $this->getChildHtml('newsletter') ?>’, place it in the temple, something like this, after the ‘left’:

<?php echo $this->getChildHtml('left') ?>
<?php echo $this->getChildHtml('newsletter') ?>

but of course, if you use a one column template for your homepage then it wont’ show up because one column only reference to ‘content’.

Lets say that I want newsletter to be in a div i made in /app/design/frontend/default/default/template/page, i’ve open the newsletter.xml and gave it the positionname, and deleted it from the other xml files, where it had callouts.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ExactRail
Jr. Member
 
Total Posts:  14
Joined:  2008-08-28
 

I was able to add this to the CMS for the home page to get the box to show up:

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

The form works properly and enters the email address into the system. However, there is no success message for the user to see that the form was successful. I have tried adding the following to the page, but it hasn’t worked either:

{{block type="core/messages" template="core/messages.phtml"}}

Any thoughts?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ExactRail
Jr. Member
 
Total Posts:  14
Joined:  2008-08-28
 

I figured it out…

I found this in app/design/frontend/default/default/template/page/3columns.phtml:

<?php echo $this->getChildHtml('global_messages'?>

The home page template I was using was actually using 1column.phtml; which does not contain this line.

I added it like so…

<!-- start middle -->
        <
div class="middle-container">
            <
div class="middle col-1-layout">
                
<?php echo $this->getChildHtml('breadcrumbs'?>
            
<!-- start center -->
                <
div id="main" class="col-main">
                <!-- 
start global messages -->
                    
<?php echo $this->getChildHtml('global_messages'?>
                
<!-- end global messages -->

                <!-- 
start content -->
                    
<?php echo $this->getChildHtml('content'?>
                
<!-- end content -->

and now it works great!

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

XML solution worked great for me! Remember and refresh the cache though smile

Thanks guys!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vagabond Jewelry
Sr. Member
 
Total Posts:  83
Joined:  2009-03-14
 

I’m sorry guys- I’m just not getting this wo work. My Newsletter subscribe box wants to be on the left. I want my newsletter subscribe box on the right. Useing CMS, I WAS able to get it into the footer- but- somehow it got there without the text. It’s just a textbox and the button subscribe, nothing about newlsletters. a little confusing, and, anyway, the footer isn’t wher I want it. I want it on the right. Is there a CMS way to do this, or must it be XML?

My XML currently looks like this:

<default>

<!-- Mage_Checkout -->
<reference name="top.links">
<block type="checkout/links" name="checkout_cart_link">
<action method="addCartLink"></action>
<action method="addCheckoutLink"></action>
</block>
</reference>
<reference name="right">
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
</block>
</reference>

</default>

If I do need to do XML, what, really, am I changing? I can’t find a left to change to right. I don’t think that’s even the page I’m trying to modify, as it clearly states it is the checkout, but everything in my newsletter.xml says checkout. I’m having trouble....

Thanks for any help,
Kest

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vagabond Jewelry
Sr. Member
 
Total Posts:  83
Joined:  2009-03-14
 

Whoe- nevermind. I was being EXCEPTIONALLY dumb. Had the wrong file open. Wee. Sorry. damn.

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