Jump to:

1369 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » Enquiry Form in HomePage Sidebar

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 301 Views
  • arthurdent
    Avatar
    Community Member
    149 Posts

    Enquiry Form in HomePage Sidebar Link to this post

    There must be a simple way to do this but I can't find one. Everything online seems to be deprecated, UserForms is crashing my SS3 install... all I really want is a way the site viewers can make a simple enquiry from the homepage! Does anybody have experience with this sort of thing and would they like to share how they did it?

  • arthurdent
    Avatar
    Community Member
    149 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    Cracked it! Forget about hacking PHP and deprecated code -- use the silverstripe-enquiry-page module and edit code as desired! Sorted!

  • camfindlay
    Avatar
    Forum Moderator
    146 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    Hey arthurdent

    Can you post a link to the module you are referring too? also if you have solved your problem... why not edit your original post and add [solved] to the start of it to help others

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    Hi

    I recently created this module, maybe this will help

    https://github.com/thomaspaulson/silverstripe-contactform

  • arthurdent
    Avatar
    Community Member
    149 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    OMG!!!!!

    My initial solution (above) worked for a single contact form on the homepage, which isn't really ideal! However the module prepared by thomas.paulson has solved my problem and I can now have a simple contact form included in my 'call to action' on EVERY page of my site (not as 'in your face' as it sounds -- it's in the footer : )

    Kudos to you thomas -- I've spent far too much time working over deprecated commands and breaking my install!! You have MADE MY DAY!!

  • arthurdent
    Avatar
    Community Member
    149 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    Sorry Cam -- I thought 'Cracked it' could stand in for '[solved]'!

    Module I was referring to is http://addons.silverstripe.org/add-ons/axllent/silverstripe-enquiry-page. Form pages set up here are editable in the CMS, but I really don't need anything his complex in the page footer. It is, however, excellent for more 'intense' forms and includes spam protection.

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    Thank you arthurdent for your reply,

    Good to know my code worked.

  • arthurdent
    Avatar
    Community Member
    149 Posts

    Re: Enquiry Form in HomePage Sidebar Link to this post

    The continuing story -- now I want to add a CAPTCHA to my form so I don't get bombarded with spam...

    I found the SilverStripe spamprotection module and downloaded the associated recaptcha module. Did a dev/build/ and ?flush=all for good measure (nothing seems to happen which, in itself, is a bit odd?) and added the following to ContactForm.php:

    $form->enableSpamProtection();

    which resulted in the 'white screen of death' (500 error)

    Changing the code the the following:

    $this->enableSpamProtection();

    gave me a different error:

    PHP Warning: file_get_contents(): Filename cannot be empty

    Anybody have any idea what this means?

    301 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.