Awesometoast.com

Fixing stuff and maybe other things.

Posts in the "Web Design" category ↓

SparkPost: Dynamic subject lines in email templates

Moving to Mandrill to SparkPost this week? (A lot of us are thanks to this.)

In Mandrill (and possibly other transactional email services) we can use the API to send emails using templates. We send a bunch of information including recipients, content, metadata, and subject, ad we let ‘er fly. Boom, done.

For the most part, I’ve found SparkPost to be pretty similar, except on one point: subject lines. Specifically for emails sent using templates. When you’re using a template, several … Keep reading »

Posted under: Fixing Stuff, Web Design | 1 Comment »

PHP: Convert US State names to their abbreviations and vice-versa

Sometimes you need to convert state names to their abbreviations. Sometimes you need to convert state abbreviations to their names.

Well, this function does both.

Give it a valid state abbreviation, and it’ll give you the name. Give it a name, and it’ll give you the abbreviation. (e.g. OR -> Oregon, Oregon -> OR). Enjoy! Hope it helps.

/* ———————————–
* CONVERT STATE NAMES!
* Goes both ways. e.g.
* $name = ‘Orgegon’ -> returns “OR”
* $name = ‘OR’ -> returns “Oregon”
Keep reading »

Posted under: Web Design | No Comments »

Is your Bootstrap X-Editable plugin stuck in 2015?

At least as of version 1.5.1, the awesome Vitalets Bootstrap X-Editable plugin has a maximum date for its datepickers of 2015. Why? I dunno. I just work here. But it’s a simple fix.

After you get things rolling by applying the plugin to whatever element, like so…
$(‘#thing’).editable();
Change the default maximum year thusly:
$.fn.combodate.defaults.maxYear = 2531;
Or whatever year you want.

While you’re there, you could also change the minimum date to something a little more recent than 1970:
$.fn.combodate.defaults.minYear = 2010;

Posted under: Fixing Stuff, Tech Stuff, Web Design | No Comments »

Flash/Pulse a Border Color With jQuery

Sometimes you want to draw a user’s attention to a certain input or element. One way to do that is to flash or pulse the element. But when you google this, most examples involve flashing the whole background, such as with jQuery UI’s highlight effect. But if you’re like me—as I definitely am— you might think that is a little much. Or maybe it just doesn’t fit well with your design. Here’s how to do it without extra … Keep reading »

Posted under: General Stuff, Web Design | No Comments »

Getting CORS to work with Apache

Ok, if you’re reading this, I’m assuming you know what CORS means, so I won’t tell you that it stands for Cross Origin Resource Sharing. Or maybe I just told you.

Anyway, you want to enable it on your Apache server. Maybe, like me, you’re building an API-based web app. So you need some JavaScript to pull data from a remote server. (Or even, like in my case, a different subdomain on the same physical server.) It’s easy in … Keep reading »

Posted under: Fixing Stuff, Web Design | 19 Comments »

Using Sandbox always fails with PayPal IPN (PHP)

Warning: This post assumes you’re already familiar with IPN, and you’re just having trouble, well, troubleshooting it.

Okay, let’s say you’re setting yourself up with PayPal IPN. You’ve set up a PHP listener not unlike this one. You’re all set, right? Ready to test it out with PayPay’s IPN Simulator! Yeah!

Except it fails. It always fails. Why?

To try and figure it out, I set up a file named paypal.txt and told my listener to write … Keep reading »

Posted under: Fixing Stuff, Web Design | 3 Comments »

Access a mapped network drive from PHP (Windows)

So you want to do something on a mapped network drive using PHP, but it simply tells you it couldn’t find the drive? Worry not.
What’s going wrong?
The problem is that PHP runs under the SYSTEM account, and the SYSTEM account can’t access mapped drives.
The solution:
So, we need to map the drive from the SYSTEM account. You can do this from your PHP script, but if you need persistent access, we can do this:

1. Download the … Keep reading »

Posted under: Fixing Stuff, Web Design | 6 Comments »

What your visitors are (and aren’t) looking at

Eye-tracking studies can be extremely revealing about how your users are using your site in the real world. Unfortunately, they can also be extremely expensive and time-consuming to conduct. Not everyone in charge of a website has those kind of resources.Luckily for us, some organizations have made some of their information public, giving us the chance to do gain some insights about our own pages.

Splash pages and Flash intros—just don’t.

Not that many people are even doing this these days, but I just ran into a couple of them and suddenly feel it’s worth mentioning again. Splash pages are pure evil.

(Okay, maybe not pure evil. But some kind of evil, for sure, even if it’s just the annoying kind.)

What is a splash page, you ask? You’ve probably seen them. It’s a sort of front door to a website, and they are often made with Flash. Here’s an example:

Keep reading »

Posted under: Web Design | 1 Comment »

Web interfaces: how not to confuse your visitors away

Though it can be easy to think otherwise, web design is much more than just putting content on a site and calling it a day. And, because people interact differently with the web than with printed materials such as newspapers and magazines, we can’t treat it the same when we design for it. There are many facets to good web design, and this article is about one of the most important we need to think about when we design…. Keep reading »

Posted under: Educational Psychology, Web Design | 1 Comment »
Page 1 of 212