Newsletter signup into footer

Hi all,

I’m trying to place the newsletter signup directly into the footer of the page by copying and pasting this code from subscribe block

{* $Id: subscribe.tpl 10972 2010-10-21 13:58:18Z klerik $ *}<br />
<br />
{if $items}<br />
<div class="newsletter"><br />
<form action="{""|fn_url}" method="post" name="subscribe_form"><br />
<input type="hidden" name="redirect_url" value="{$config.current_url}" /><br />
<br />
<p>{$lang.text_signup_for_subscriptions}</p><br />
{foreach from=$items item=list name="mailing_lists"}<br />
	<div class="select-field"><br />
		<label for="mailing_list_{$block.block_id}{$list.list_id}"><br />
			<input id="mailing_list_{$block.block_id}{$list.list_id}" checked="checked" type="checkbox" class="checkbox" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}<br />
		</label><br />
	</div><br />
{/foreach}<br />
<div class="select-field"><br />
	<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}"><br />
</div><br />
{strip}<br />
<div class="form-field"><br />
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label><br />
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" /><br />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}<br />
</div><br />
{/strip}<br />
</form><br />
<br />
</div><br />
{/if}<br />

```<br />
In previous versions this worked just fine, it seems that in the current version 2.1.2 they switched some code around and just simple copying and pasting of code wont work anymore.

Anyone ?

Is what I’m looking to do that difficult of a task ?

Well I didn’t put a sign up in the footer, but I did make it a block.



Here is what I have:







The block is set up like:







To set this up:



1.) In addons/news_and_emails/schemas/block_manager/structure.post.php



Change:


'appearances' => array (
'addons/news_and_emails/blocks/subscribe.tpl' => array (
'params' => array (
'sidebar' => true,
'block' => true,
),
)




To:


'appearances' => array (
'addons/news_and_emails/blocks/subscribe.tpl' => array (
'params' => array (
'sidebar' => true,
'block' => true,
)
),
'addons/news_and_emails/blocks/banner_subscribe.tpl' => array (
'params' => array (
'sidebar' => true,
'block' => true,
),
)




2.) Create a file called skins/your-skin/customer/addons/news_and_emails/blocks/banner_subscribe.tpl



Put in this code:


```php







{foreach from=$items item=list name="mailing_lists"}



{/foreach}




{strip}


{$lang.email}


{include file="buttons/submit_button.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
{/strip}

```

3.) I also changed the submit button. To do this create a file called skins/your-skin/customer/buttons/submit_button.tpl

In there put:

```php
```

You will need to replace the image with the one you want.

4.) These are the styles I used:

```php .banner_3{
background:url('images/banner_3.jpg') left top no-repeat;
width:311px;
height:196px;
float:left;
margin:10px 0 0 172px;
padding:0px;
}
.banner_3 p{
float:left;
background: url('images/banner_search.jpg') left top no-repeat;
margin:40px 0 0 15px;
height:35px;
width:157px;
float:left;
}
.banner_3_search{
float:left;
background:none;
height:35px;
font-size:11px;
padding:0 5px 0 5px;
margin:0 0 0 15px;
line-height:35px;
color:#aaaaaa;
width:147px;
border:none;
}
.banner_3 span{
float:left;
margin:0px;
padding:10px 0 0 18px;
width:200px;
} ```

I hope that helps. It might not be perfect for you, but hopefully it will get you going in the right direction.

Brandon

thanks for the detailed reply brandon.



Unfortunately I don’t have enough coding experience to understand what I need to do in order to get the desired results.

Well, can you put together a screen shot or some other type of image that shows what you want?



The example I gave was for a block, but since you want it in the footer, the coding might be more straight forward.



One thing that you could try is just to have something like:



{include file="{$config.skin_path}/addons/news_and_emails/blocks/subscribe.tpl"}




In your bottom.tpl code where you want the sign up box.



Also, have you tried doing something as simple as adding a block in your footer? I haven’t tried it yet, but if you set up the block like the image below than it might work.







If you post more about what you want maybe we’ll have a better idea of how to help.



Brandon

[quote name=‘brandonvd’]Well, can you put together a screen shot or some other type of image that shows what you want?



The example I gave was for a block, but since you want it in the footer, the coding might be more straight forward.



One thing that you could try is just to have something like:


<br />
{include file="{$config.skin_path}/addons/news_and_emails/blocks/subscribe.tpl"}<br />

```<br />
<br />
In your bottom.tpl code where you want the sign up box.<br />
<br />
Also, have you tried doing something as simple as adding a block in your footer? I haven't tried it yet, but if you set up the block like the image below than it might work.<br />
<br />
[img]http://www.saltwatertogo.com/help/sign_up_footer.jpg[/img]<br />
<br />
If you post more about what you want maybe we'll have a better idea of how to help.<br />
<br />
Brandon[/QUOTE]<br />
<br />
Including the file in the bottom.tpl does not work in version 2.1.2 as the code has changes.<br />
<br />
Simply, what I'm trying to do have the newsletter signup in the bottom.tpl see this image. <br />
![](upload://pYVYTrcSnbabANGoWZZ89tmBZBK.jpeg)<br />
[QUOTE]<br />
Also, have you tried doing something as simple as adding a block in your footer? I haven't tried it yet, but if you set up the block like the image below than it might work.[/QUOTE]<br />
Yea that's how I'm going to do it if I can't figure this thing out.<br />
<br />
thanks again for your help :)

There is probably an override hook for the footer (bottom.tpl) for some addon or my_changes change. An “override” will override any previous info, even other overrides…

[quote name=‘tbirnseth’]There is probably an override hook for the footer (bottom.tpl) for some addon or my_changes change. An “override” will override any previous info, even other overrides…[/QUOTE]



The problem is that moving the newsletter signup code seems to be custom made to be used in blocks and moving this code to any place other then a block makes it inoperable.

Suggest you do it as an override (or post) in the news_and_emails addon. I.e. skins//customer/addons/news_and_emails/hooks/index/bottom.override.tpl. But if I recall, the whole listing is dependent upon an {if $mailingLists} which needs to be set in a controller first.

Thanks tbirnseth and brandonvd. It’s seems a bit more complicated than I imagined, so it’ll just have to go on the back burner for the time being :slight_smile:

Not sure this will work for everyone but I created an HTML block in the footer and used the code below. Worked like a charm. Replace folder_to_store with the folder your store is in. This assumes you only have one newsletter and that you always want to send newsletters in HTML.


```php



Signup for our Newsletter !






```