In This Article:

    Redirecting all donation pages (but you can redirect anything....)

    In This Article:

      Background

      A client moved to a different donation gathering vendor (NationBuilder) and wanted all of Salsa's donation pages redirected to the main donation page on the new vendor.  This article describes the solution, the logic behind the solution, and shows the script that was used.

      Solution

      Putting a redirect script into the default template!

      Note the "if" statement that makes sure that the script only runs on donation pages (if you need a broader solution, see Variations below).

      2015-04-01_1316.png

      Testing showed that this script works on all cases of the Disabled field (0, 1, and null).

      Variations

      If you like the script but need to redirect other kinds of pages, then here are some variations to use:

      Redirect from one URL to another

      Redirect all of another kind of page

      Change donate_page_KEY in the script to PAGE_TYPE_KEY. The example redirects all action pages:

      Redirect Salsa page using a key

      1. View the page.
      2. Retrieve the page type and key from the browser's address bar. For example, an event page will have event_KEY=a_number.
      3. Change donate_page_KEY in the script to the page type and key value. The example redirects event_KEY=12345:

      Redirect a bunch of different pages

      The best solution will be to use a regular expression to define the pages that need to be redirected. Your best bet will be to describe the pages that need to be redirected and send mail to developers@salsalabs.com for help.

      Initial Idea That Didn't Work

      Defining a common redirect template for all donation pages seemed like a good idea at first, but not so much.  For his first try, The Great and Powerful Allen created a redirect template which could be built out using the ideas from this StackOverflow discussion. For example:

      Once the template is done, then it would be a simple update to the database to change all donation pages to use the same template:

      update donate_page set template=TEMPLATE_KEY where organization_KEY=WHATEVER;

      Why it didn't work

      Salsa checks to see if a donation page is disabled before a page is rendered. (A donation page is disabled if the Disabled field is 1.) If a donation page is disabled, then Salsa

      1. ignores the special redirect template,
      2. stuffs a "not available" message into the default template, and
      3. renders just the message.

      Questions?

      If you have questions, then please gather this information:

      1. Your organization_KEY
      2. Your chapter_KEY if you are in a chapter
      3. The list of page types and page keys that you want to redirect
      4. The URL(s) where these pages should be redirected.

      Send this information to support@salsalabs.com and we'll be glad to help.

      Was this article helpful?
      0 out of 0 found this helpful
      Have more questions? Submit a request

      Comments

      0 comments

      Please sign in to leave a comment.