10377 Posts in 2193 Topics by 1709 members
| Go to End | Next > | |
| Author | Topic: | 4623 Views |
-
Newsletter Module: include subscription form

2 October 2009 at 11:01pm
Hello all,
I have created a subscription form to register on the newsletter lists. Is there a way to publish this form on other pages, for example in the sidebar?
greets,
Nico -
Re: Newsletter Module: include subscription form

3 October 2009 at 12:43am
i managed to show the form on other pages by putting this in the pagecontroller
function ShowForm(){
$get = DataObject::get_one('UserDefinedForm', "URLSegment = 'subscribe'");
return new UserDefinedForm_Controller($get);
}and this in page.ss
<% control ShowForm %>
$Form
<% end_control %>However the available newsletter lists checkboxes are not included, does anyone have an idea what could be causing this?
-
Re: Newsletter Module: include subscription form

3 October 2009 at 12:46am
seems i was a bit hasty, this does the trick
function ShowForm(){
$get = DataObject::get_one('SubscribeForm', "URLSegment = 'subscribe'");
return new SubscribeForm_Controller($get);
} -
Re: Newsletter Module: include subscription form

3 October 2009 at 1:08am Last edited: 3 October 2009 1:09am
correct me if i'm wrong, but wouldnt a simple $ShowForm in the .ss template be sufficient? I cant see the need for the control?
-
Re: Newsletter Module: include subscription form

3 October 2009 at 1:16am
using a simple showform throws an error
"Uncaught Exception: Object->__call(): the method 'fortemplate' does not exist on 'SubscribeForm_Controller'"
-
Re: Newsletter Module: include subscription form

3 October 2009 at 10:28pm
Interesting, i should have tested it before opening my big mouth!
What about $Showform.Form ??
Ive done this on a site before, ill have to dig up the code when i get back to work. I know there isnt much point if your method works, but im just interested thats all!
-
Re: Newsletter Module: include subscription form

4 October 2009 at 1:45am
nice, that worked too, much cleaner, thanks for the tip
-
Re: Newsletter Module: include subscription form

27 December 2009 at 5:38am
I would like to include the newsletter subscription form to my Homepage. I have tried the previously mentioned ways but cant seem to get it to show. I noticed this in my Page.ss file - $Form -. I copied and pasted this to my HomePage.ss file and nothing.
I am not sure of the solution. I am new to Silverstripe. If anyone has any ideas that would be great thanks.
| 4623 Views | ||
| Go to Top | Next > |


