Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » [resolved] Newsletter module question : Subscription form

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1152 Views
  • 1k2k3
    Avatar
    Community Member
    15 Posts

    [resolved] Newsletter module question : Subscription form Link to this post

    For those who don't know my post is referring to the module from http://ssorg.bigbird.silverstripe.com/newsletter-module/

    Is there anyway to develop your own little subscription area for every page instead having the form on a separate page?

    For example the theme I've developed has two columns and I wish to have some sort of subscription area on my left column and $Layout from CMS on the right column. How would I go about doing this?

    Some research I've already done on this subject is from
    http://ssorg.bigbird.silverstripe.com/all-other-modules/show/270155?start=0
    http://ssorg.bigbird.silverstripe.com/all-other-modules/show/260123
    http://doc.silverstripe.org/recipes:simplesignupform

    I forgot to mention that you have to create a page named "subscribe" in which you include a subscriptionform.

    first I created my 'subscribe' page.
    http://img97.imageshack.us/img97/4144/subscribe.gif

    I then updated my PageController
    Source Location: /mysite/code/Page.php

    function ShowForm(){
    $get = DataObject::get_one('UserDefinedForm', "URLSegment = 'subscribe'");
    return new UserDefinedForm_Controller($get);
    }

    After that I updated my Page.ss with

    <% control ShowForm %>
    $Form
    <% end_control %>

    I flushed my website http://localhost/silverstripe/?flush=1

    I'm now given this error.

    Website Error
    There has been an error
    The website server has not been able to respond to your request.

    Screen dump: http://img825.imageshack.us/img825/5116/error.gif

    Trouble shooting I then modified Page.ss again and replaced the code with...

    $Showform.Form

    Flush but the 'Website Error' is still being returned.

    More trouble shooting I referred too Normann post and modified my PageController

    function SubscribleBlurb(){
    $subscribeForm = = DataObject::get_one('SubscribeForm');
    if($subscribeForm && Translatable::is_enabled()){
    $locale = Translatable::get_current_locale();
    $subscribeForm = $subscribeForm->getTranslation($locale);
    }
    if($subscribeForm) {
    $formController = new SubscribeForm_Controller($subscribeForm);
    retrun $formController->Form()->fortemplate();
    // or return $formController->Form()->renderWith('Form', 'your customise form template');
    }
    }

    Updated my Page.ss

    $SubscribleBlurb

    Did a http://localhost/silverstripe/?flush=1 and the website returned with error

    Parse error: syntax error, unexpected T_VARIABLE in G:\xampplite\htdocs\silverstripe\mysite\code\Page.php on line 22

    I've decided to uninstall the module until this can be resolved my apologizes for the wall of text, any replies will be appreciated thanks! for your time

    I know the thread was posted in 2009 so I presume the version of SilverStripe was different at the time and things such as differences in code have been removed/added, but how would I go about doing this with SilverStripe v2.4.1, I also understand whether the community does or does not support this module anymore.

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: [resolved] Newsletter module question : Subscription form Link to this post

    LOL that is a wall of text I skim read it sorry.
    Did you try $ShowForm
    instead of $ShowForm.Form
    And have you written a UserDefinedForm to get? Wont work other wise. If you define your form on Page.php You'll be able to call it in all pages that extend form. Sorry if that wasn't that helpful.

  • 1k2k3
    Avatar
    Community Member
    15 Posts

    Re: [resolved] Newsletter module question : Subscription form Link to this post

    Yeah I have and it throws errors as far as I know. Thanks

  • 1k2k3
    Avatar
    Community Member
    15 Posts
    1152 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.