by Allen Leonard
The bug in Salsa comes to us courtesy of CPAWS (Canadian Parks and Wilderness Society) . CPAWS very kindly advised us that Salsa doesn't have the correct abbreviation for the province of Newfoundland. The official abbreviation is "NL" (for Newfoundland and Labrador) and not "NF" as it appears in Salsa.
Challenge: Change the abbreviation for Newfoundland
The challenge today, then, is to change the abbreviation for Newfoundland anywhere that it appears. "Newfoundland" is found in the list of states and provinces, so it can appear in any signup, donation, action or event page.
Also, for just a bit of fun, we'll also show the supporter "Newfoundland and Labrador" instead of just "Newfoundland". Y'know, just because we can, and because the screenshots will be more interesting if we do.
The best place to put this particular fix is in your main template. Doing that means that any Salsa page that uses the template will have this fix in place. Naturally, if you site uses more than one template, then this fix should go into the others, too.
As you can see from the screenshot, the user sees "Newfoundland" in the list of states:
Let's start with some caveats, if you don't mind:
- If you are testing this, and don't want to modify your default template, then copy it to a new template. If you have questions about doing that, please then please email us and we'll be glad to show you how.
- If you are on the DLCC node, then this procedure is not for you. Sorry. Please email us and we'll see what we can do to help out.
Okay! let's get started!
- Click on the "Website Management" tab, choose "templates" from the menu, and edit the template that you want this fix to be in.
- Go to the bottom of the template. Insert this script right before the </body> tag.
- When you are done, your code should look like this:
- Save your work. You are done!
When you open your signup (donation, event, action, etc.) form, click on the "State" button, and you'll see that "Newfoundland" has been replaced with "Newfoundland and Labrador":
To confirm that the abbreviation has changed, simply add a new supporter and choose "Newfoundland and Labrador" as the state. I did that, and here's what the supporter profile looked like when I got done:
There's "NL" right where we expect it. (My apologies to the Canadians in the audience. I used a U.S. zipcode and not an official postal code.)
Thanks for reading this blog. If you have any questions, or what more details, then send me some email , and I'll be glad to help out. Until next time, y'all have an excellent week!