2017 © Pedro Peláez
 

silverstripe-module silverstripe-thankfully

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

image

zanderwar/silverstripe-thankfully

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  • Thursday, June 15, 2017
  • by zanderwar
  • Repository
  • 1 Watchers
  • 2 Stars
  • 47 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

silverstripe-thankfully

If you're tired of having to continuously create dozens of different "Thank You" pages than thankfully this module exists!, (*1)

With this module you can easily create a "Thank You" page that is configurable in the CMS for any page type that you assign this module to., (*2)

Features

  • Page creates itself under the parent on dev/build
  • Query string support for conversion tracking etc, configurable from the CMS

Installation

Installation is supported via composer only:, (*3)

$ composer require zanderwar/silverstripe-thankfully ~2.0

Run a dev/build afterwards, (*4)

Configuration

  1. Open your mysite/_config.php file
  2. Add: php ContactPage::add_extension('ThankfullyExtension'); ContactPage::add_extension('ThankfullyControllerExtension');
  3. Run a ?flush=1
  4. Open the page that has ContactPage (in this example) as the type within the CMS and you will now see a "Thank You" tab

In your controller (in this example ContactPage_Controller) you now have access to the method $this->getThankYouPage() which you can then immediately return $this->redirect($this->getThankYouPage()->Link()). This would most commonly be done in a form processing method, (*5)

If the page title and/or content is not set in the page with the extension, it will fallback to the values set in the Thank You (Generic) that the dev/build created in the root of your site tree, if no defaults are configured, then the visitor will get a bit of an ugly experience, (*6)

Example

class ExamplePage_Controller extends Page_Controller {

    private static $allowed_actions = array(
        'index'
    );

    public function index()
    {
        /** @var ThankfullyPage $thankYou */
        $thankYou = $this->getThankYouPage();
        $thankYou->setAllowed(true); // Required if "Always Allowed" is disabled in the CMS
        $thankYou->setReturnTo('/home/'); // Optional, if not provided the link to the parent page will be used

        return $this->redirect($thankYou->Link());
    }
}

Contributing

If you would like to contribute to this repository, please follow the contributing guide., (*7)

License

Click here for more information about the licensing of this module, (*8)

Issues

To report issues with this module, please use our issue tracker., (*9)

The Versions

15/06 2017

dev-master

9999999-dev

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  Sources   Download

MIT

The Requires

 

silverstripe thanks

15/06 2017

2.0.1

2.0.1.0

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  Sources   Download

MIT

The Requires

 

silverstripe thanks

27/05 2017

2.0.0

2.0.0.0

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  Sources   Download

MIT

The Requires

 

silverstripe thanks

27/05 2017

dev-feature/refocus

dev-feature/refocus

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  Sources   Download

MIT

The Requires

 

silverstripe thanks

27/05 2017

dev-todo/tests

dev-todo/tests

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  Sources   Download

MIT

The Requires

 

silverstripe thanks

24/05 2017

1.0.1

1.0.1.0

A module designed to reduce the potentially thousands of Thank You pages that can be sometimes needed for large sites

  Sources   Download

MIT

The Requires

 

silverstripe thanks