Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

How to add a "Subscribe Form" into the another page


Go to End
Reply

14 Posts   6596 Views

Avatar
roterl

10 June 2008 at 11:06pm Community Member, 44 Posts

Hi
How can I add Newsletter subscribe form into another page ?
I created a newsletter and "Subscribe Form" type page for it, and the subscription work fine. But I need it to be inside other page, and not as its own page.
How can I do it?

Thanks,
Rotem.

Avatar
roterl

16 June 2008 at 5:33pm Community Member, 44 Posts

does any one have idea ??
thanks.

Avatar
Willr

16 June 2008 at 6:00pm Forum Moderator, 5511 Posts

You can do something like this in the template

<% control Page(URL of Your Subscribe Page) %>
$SubscribeForm - or whatever you have called it
<% end_control %>

Avatar
roterl

17 June 2008 at 7:21pm Community Member, 44 Posts

I added:

<% control Page(Subscribe) %>
inside Subscribe Page
$SubscribeForm
<% end_control %>


(also tried $Form instead of $SubscribeForm) but that does not work. (The "inside Subscribe Page" is displayed)

any idea?
thanks

Avatar
Willr

17 June 2008 at 7:36pm Forum Moderator, 5511 Posts

try using a $Title or another field inside the control thats unique to that page to make sure its controlling the correct page. You could also try Page(Subscribe) with a lower case s. I think it uses the URL and that might be case sensitive.

Avatar
roterl

17 June 2008 at 7:44pm Community Member, 44 Posts

Adding other field work well.

<% control Page(subscribe) %>
inside Subscribe Page
      $Content
      $Form
<% end_control %>


I see the page content but not the form. (Also work with $Title)
Also when I remove the $Form from the Page.ss file, the form indeed removed from the Subscribe page itself, so I guess this is the field I should use.
Both uppercase and lowercase 's' do the same.

Avatar
roterl

19 June 2008 at 6:20am Community Member, 44 Posts

any idea?
$Content and $Title work well, but $Form dont :(

thanks

Avatar
Willr

19 June 2008 at 9:22am Forum Moderator, 5511 Posts

Ok a couple things you can do -

* move the subscribe form code to Page.php so you can call the form from anywhere.

* Or add a method to page.php which gets the form off the subscribe page

// page.php (subscribe form is a 'SubscribeForm' method in a SubscribePage)

function SubscribeBox() {
return singleton("SubscribePage")->SubscribeForm();
}

Go to Top