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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Where is the Newsletter sign up located


Reply


4 Posts   606 Views

Avatar
Sue

Community Member, 26 Posts

23 August 2011 at 4:57am

Please see the site here http://www.tlmlandscaping.com/. On the bottom of each page is a sign up for newsletter. How do I remove this? (I inherited this website from another designer and am only beginning working with SilverStripe. Thanks!

Sue

Avatar
swaiba

Forum Moderator, 1805 Posts

23 August 2011 at 5:36am

It'll be in a template file (*.ss) and probably in the theme folder. I'd download the site and search for "EmailTipsForm" to find it.

Good luck Sue!

Avatar
Sue

Community Member, 26 Posts

23 August 2011 at 8:32am

I found the following code on 2 pages, Page.php and FormPage.php - Do I just delete the info and save the page? Do I need to do a flush to make it take effect (that may be the part I forgot)? and can you remind me of what I add to the domain name to flush?

Thanks
Sue

   /**
    * submit email address for newsletters and tips form
    */
   function EmailTipsForm() {
      $heading = "Sign up for Hints & Tips e-Newsletter";
      $fields = new FieldSet(
       new EmailField("EmailAddress", $heading)
       );
      $actions = new FieldSet(
       new FormAction('SubmitEmailForTips', 'Submit')
       );

       return new SearchForm($this, "EmailTipsForm", $fields, $actions);
   }
   /**
    * Process tips email
    */
   function SubmitEmailForTips($data, $form){

      $emailSent = $data['EmailAddress'];
      
      $submission = mysql_query("
         INSERT INTO `TLM_contacts` (
            `id`,
            `FirstName`,
            `LastName`,
            `BusinessName`,
            `Address_1`,
            `Address_2`,
            `City`,
            `State`,
            `Zip`,
            `Email`,
            `PhoneNumber`,
            `FaxNumber`,
            `MobileNumber`,
            `Message`
         ) VALUES (
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            '$emailSent',
            NULL,
            NULL,
            NULL,
            NULL
         )") or die (mysql_error());
      
      Director::redirectBack();
   }

   function Siblings() {
      $whereStatement = "ParentID = ".$this->ParentID;
      return DataObject::get("Page", $whereStatement);
   }
   
}

Avatar
swaiba

Forum Moderator, 1805 Posts

23 August 2011 at 8:49am

you could always just remove the entire "function EmailTipsForm() {...". then you won't need the dev/build

There should be something in a template like $EmailTipsForm that is putting it on the page. for basic questions there is an intro for that - http://www.silverstripe.org/general-questions/show/16055