Archive for October, 2011

Create Perfect Emails For Your WordPress Website





 



 


Whatever type of website you operate, its success will probably hinge on your interaction with your audience. If executed well, one of the most effective tools can be a simple email.

image2

WordPress users are in luck, since WordPress already has easy-to-use and extendable functions to give you a lot of power and flexibility in handling your website’s emails.

In order to create our own system, we will be doing four things. First, we will create a nice email template to use. We will then modify the mailer function so that it uses our new custom template. We will then modify the actual text of some of the built-in emails. Then we will proceed to hook our own emails into different events in order to send some custom emails. Let’s get started!

How WordPress Sends Emails

WordPress has a handy function built in called wp_mail(), which handles the nitty-gritty of email sending. It is able to handle almost anything you throw at it, from custom HTML emails to modifications to the “From� field.

WordPress itself uses this function, and you can, too, by using WordPress hooks. You can read all about how hooks work in WordPress, but here is the nutshell version, and we will be working with them in this article so much that you’ll learn it by the end.

Hooks enable you to add your own functions to WordPress without modifying core files. Without hooks, if you wanted to send a publication notice to the author of a post, you would have to find the function that published the post and add your own code directly to it. With hooks, you write the function for sending the email, and then hook it into the function that publishes the post. Basically, you are telling WordPress to run your custom function whenever the function for publishing posts runs.

Setting Up Shop

The first thing we’ll have to do is create a plugin. We could get away without it and just use our theme’s functions file, but this would become clunky in the long run. Don’t worry: setting up a plugin is super-easy.

Go to your website’s plugins folder, which can be found under wp-content. Create a new folder named my_awesome_email_plugin. If you want a different name, use something unique, not email or email_plugin; otherwise, conflicts might arise with other plugins.

Create a file named my_awesome_email_plugin.php in the new folder. The name of the file (without the extension) must be the same as the name of the folder.

Edit the contents of my_awesome_email_plugin.php by copying and pasting the code below and modifying it where necessary. This is just some default information that WordPress uses to show the plugin in the plugins menu in the admin area.

<?php
/*
Plugin Name: My Awesome Email Plugin
Plugin URI: http://myawesomewebsite.com
Description: I created this plugin to rule the world via awesome WordPress email goodness
Version: 1.0
Author: Me
Author URI: http://myself.me
*/

?>

Once that’s done, save the file, go to the WordPress admin section, and activate your new plugin. If you’re new to this, then congratulations! You have just created your first working WordPress plugin! It doesn’t really do anything yet, but don’t let that bother you. Just read on, because we’ll be adding some functionality after the next section.

Creating An Email Template

Creating good email templates is worth an article on its own. I will just share the method that I use, which does not mean that doing it differently is not allowed. Feel free to experiment!

I am not a big fan of using images in emails, so we will be building an HTML template using only CSS. Our goal is to come up with a template to which we can add a header and footer section. We will send our emails in WordPress by pulling in the header, putting the email text under that and then pulling in the footer. This way, you can change the design of your emails very easily just by modifying the templates.

Without further ado, here’s the code for the email template that I made. Or you can download it as an HTML file (right-click, and then select “Save as�). If you want a quick preview of what it looks like, just click the link.

<html>
	<head>

		<title>The Subject of My Email</title>

	</head>
	<body>
		<div id="email_container" style="background:#444">
			<div style="width:570px; padding:0 0 0 20px; margin:50px auto 12px auto" id="email_header">
				<span style="background:#585858; color:#fff; padding:12px;font-family:trebuchet ms; letter-spacing:1px;
					-moz-border-radius-topleft:5px; -webkit-border-top-left-radius:5px;
					border-top-left-radius:5px;moz-border-radius-topright:5px; -webkit-border-top-right-radius:5px;
					border-top-right-radius:5px;">
					MyAwesomeWebsite.com
				</div>
			</div>

			<div style="width:550px; padding:0 20px 20px 20px; background:#fff; margin:0 auto; border:3px #000 solid;
				moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; color:#454545;line-height:1.5em; " id="email_content">

				<h1 style="padding:5px 0 0 0; font-family:georgia;font-weight:500;font-size:24px;color:#000;border-bottom:1px solid #bbb">
					The subject of this email
				</h1>

				<p>
					Lorem ipsum dolor sit amet, consectetuer adipiscing
					elit. Aenean commodo ligula eget dolor. Aenean massa
					<strong>strong</strong>. Cum sociis natoque penatibus
					et magnis dis parturient montes, nascetur ridiculus
					mus. Donec quam felis, ultricies nec, pellentesque
					eu, pretium quis, sem. Nulla consequat massa quis
					enim. Donec pede justo, fringilla vel, aliquet nec,
					vulputate eget, arcu. In enim justo, rhoncus ut.
				</p>
				<p>
					Imperdiet a, venenatis vitae, justo. Nullam dictum
					felis eu pede <a style="color:#bd5426" href="#">link</a>
					mollis pretium. Integer tincidunt. Cras dapibus.
					Vivamus elementum semper nisi. Aenean vulputate
					eleifend tellus. Aenean leo ligula, porttitor eu,
					consequat vitae, eleifend ac, enim. Aliquam lorem ante,
					dapibus in, viverra quis, feugiat a, tellus. Phasellus
					viverra nulla ut metus varius laoreet. Quisque rutrum.
					Aenean imperdiet. Etiam ultricies nisi vel augue.
					Curabitur ullamcorper ultricies nisi.
				</p> 

				<p style="">
					Warm regards,<br>
					The MyAwesomeWebsite Editor
				</p>

				<div style="text-align:center; border-top:1px solid #eee;padding:5px 0 0 0;" id="email_footer">
					<small style="font-size:11px; color:#999; line-height:14px;">
						You have received this email because you are a member of MyAwesomeSite.com.
						If you would like to stop receiving emails from us, feel free to
						<a href="" style="color:#666">unregister</a> from our mailing list
					</small>
				</div>

			</div>
		</div>
	</body>
</html>

Remember that this is an email, so the HTML won’t be beautiful. The safest styling method is inline, so the fewer frills you can get away with, the better.

Let’s split this into two parts. The header part of the email is everything from the top right up to and including the h1 heading on row 23 (i.e. lines 01 to 23). Copy that bit and paste it into a new file in your my_email_plugin folder, and name it email_header.php. The footer part of the email is everything from the paragraph tag before “Warm regards� right until the end (i.e. lines 48 to 64). The text between the header and footer is just a placeholder so that you can see what the finished product will look like. We will fill it with whatever content we need to send at the time.

Preparing The WordPress System For Our Emails

By default, WordPress sends plain-text emails. In order to accommodate our fancy HTML email, we need to tell the wp_mail() function to use the HTML format. We will also set up a custom “From� name and “From� address in the process, so that the email looks good in everyone’s inbox. To accomplish this, we’ll be using the previously mentioned hooks. Let’s look at the code; explanation follows.

add_filter ("wp_mail_content_type", "my_awesome_mail_content_type");
function my_awesome_mail_content_type() {
	return "text/html";
}

add_filter ("wp_mail_from", "my_awesome_mail_from");
function my_awesome_mail_from() {
	return "hithere@myawesomesite.com";
}

add_filter ("wp_mail_from_name", "my_awesome_mail_from_name");
function my_awesome_email_from_name() {
	return "MyAwesomeSite";
}

On line 01, we have defined that we are adding a filter to the WordPress function wp_mail_content_type(). Our filter will be called my_awesome_mail_content_type. A filter is nothing more than a function, so we need to create the function my_awesome_mail_content_type().

Remember that actions are functions called from within other functions? We add an action to the wp_insert_user() function, and the action is performed whenever wp_insert_user() runs. Filters are specified in much the same way; but, instead of running alongside the function that it is called from, it modifies the value of the entity that it is called on.

In our case, this means that somewhere inside the wp_mail() function is a variable that holds the email type, which is by default text/plain. The filter hook wp_mail_content_type is called on this variable, which means that all attached filters will be run. We happen to have attached a filter to it on line 01, so our function will perform its task. All we need to do is return the value text/html, which will modify the value of the variable in the wp_mail function to text/html.

The logic behind the rest of the code is exactly the same. Adding a filter to wp_mail_from enables us to change the sender’s address to hithere@myawesomewebsite.com, and adding a filter to wp_mail_from_name enables us to change the sender’s name.

Modifying Existing WordPress System Emails

Welcoming New Users

This is the content of the default WordPress email.

As mentioned, WordPress has a bunch of built-in emails that can be easily controlled (using hooks, of course). Let’s modify the default greeting email that WordPress sends out to new users. This email is sent out using a so-called “pluggable function.� This function is supplied by WordPress, but, contrary to the usual core functions, you are allowed to overwrite it with your own code.

The function in question is called wp_new_user_notification(). To modify it, all we need to do is create a function with the same name. Due to the method by which WordPress calls pluggable functions, there will not be any conflict, even though you are creating a function with the same name. Below is the function that I wrote. See the explanation and preview of it further below.

function wp_new_user_notification($user_id, $plaintext_pass) {
	$user = new WP_User($user_id);

	$user_login = stripslashes($user->user_login);
	$user_email = stripslashes($user->user_email);

	$email_subject = "Welcome to MyAwesomeSite ".$user_login."!";

	ob_start();

	include("email_header.php");

	?>

	<p>A very special welcome to you, <?php echo $user_login ?>. Thank you for joining MyAwesomeSite.com!</p>

	<p>
		Your password is <strong style="color:orange"><?php echo $plaintext_pass ?></strong> <br>
		Please keep it secret and keep it safe!
	</p>

	<p>
		We hope you enjoy your stay at MyAwesomeSite.com. If you have any problems, questions, opinions, praise,
		comments, suggestions, please feel free to contact us at any time
	</p>

	<?php
	include("email_footer.php");

	$message = ob_get_contents();
	ob_end_clean();

	wp_mail($user_email, $email_subject, $message);

As you can see, the function is passed two arguments: the ID of the new user and the generated password. We will be using these to generate the variable parts of our message. On line 2, we’ve built a user object that will contain the data of the user in question. On line 7, we’ve created an email subject using the variable $email_subject.

Before we move on, let’s go back to our email_header.php file. Replace “The Subject of My Email� and “The subject of this email� (lines 04 and 22 if you’re looking at the code here) with <?php echo $email_subject ?>. We don’t want all of our subjects to be “The Subject of My Email,� so we need to pull that data from the email that we are building.

From lines 09 to 31, we are using a handy technique called “output buffering.� Because the content email_header.php is not stored inside a variable, it is included directly; this would result in it being printed right away, and we would not be able to use it in our function. To get around this problem, we output buffering. When it is turned on (using ob_start()), no output is sent from the script; instead, it is stored in an internal buffer.

So, first, we include the header, then we write our our message content, then include the footer. Because we are buffering the content, we can simply close our PHP tags and use regular HTML for our message, which I find much cleaner than storing all of it in a variable. On line 30, we pull the contents of the buffer into a variable; and on line 31, we discard the buffer’s content, since we don’t need it anymore.

With that done, we have all of the information needed to use wp_mail(). So, on line 33, we send our email to the user, which should look something like this:

Password Retrieval Emails

For some reason, WordPress doesn’t use the same pluggable functions to handle all emails. For example, to modify the look and feel of the password retrieval emails, we have to resort to hooks. Let’s take a look.

add_filter ("retrieve_password_title", "my_awesome_retrieve_password_title");

function my_awesome_retrieve_password_title() {
	return "Password Reset for MyAwesomeWebsite";
}

add_filter ("retrieve_password_message", "my_awesome_retrieve_password_message");
function my_awesome_retrieve_password_message($content, $key) {
	global $wpdb;
	$user_login = $wpdb->get_var("SELECT user_login FROM $wpdb-<users WHERE user_activation_key = '$key'");

	ob_start();

	$email_subject = imp_retrieve_password_title();

	include("email_header.php");
	?>

	<p>
		It likes like you (hopefully) want to reset your password for your MyAwesomeWebsite.com account.
	</p>

	<p>
		To reset your password, visit the following address, otherwise just ignore this email and nothing will happen.
		<br>
		<?php echo wp_login_url("url") ?>?action=rp&key=<?php echo $key ?>&login=<?php echo $user_login ?>
	<p>

	?>

	include("email_footer.php");

	$message = ob_get_contents();

	ob_end_clean();

	return $message;
}

First, we’ve added a filter to retrieve_password_title, which will modify the default value of the email’s title to our own. Then, we’ve added a filter to retrieve_password_message, which will modify the contents of the message.

On line 10, we’ve used the $wpdb object to query the database for the user’s name based on the key that was generated when the retrieval was initiated. We then do the same thing as before: we start the content buffering, pull our email header, add our message content, and pull our email footer.

One fantastic part about using hooks can be seen on line 14. Our password title needs to be “Password Reset for MyAwesomeWebsite.� We could well have typed that in, but instead we created a function (imp_retrieve_password_title()) that outputs exactly the same thing. It should be clear by now that all we are doing with these hooks is creating regular ol’ functions that can just be plugged into WordPress as actions (which run when initiated by something) or filters (which run and modify data when they are initiated).

This time, instead of using wp_mail(), all we need to do is return the message’s content. This is because we are creating a filter that modifies the contents of the password-retrieval email, nothing else. WordPress will do whatever it usually does to send that email, but now it will use our content.

Pluggable Function and Hooks

This question is not easily answered, because this is not too well documented yet. Your best bet is looking in the file pluggable.php (in your wp-includes folder) to see which emails are controlled from there. Remember not to edit this file; use the plugin we are creating here. You can scan the list of WordPress filters to find filters that control email content.

Right now, most emails are handled through pluggable functions; only the password-retrieval email and some WordPress MU emails are handled using hooks. This might change, as development is quite active, but I would guess that if any new emails are added, you will be able to use pluggable functions.

Here is a list of emails that you can modify using pluggable functions:

  • Notify authors of comments: wp_notify_postauthor()
  • Notify moderator of comments waiting for approval: wp_notify_moderator()
  • Notify administrator of password changes on the website: wp_password_change_notification()
  • Notify administrator of new registrations: wp_new_user_notification()

Adding New Emails To The System

So far, we’ve just been modifying what WordPress has to offer. Now it’s time to add some emails of our own! Let’s implement an email that will notify an author when you have published their post.

To accomplish this, we need to find the WordPress action hook that publishes a post when we press the “Publish� button. We then have to hook our own function into that, which will perform the task of sending the email.

Looking at the list of action hooks, we can see that the hook we are looking for is called {$new_status}_{$post->post_type}. This looks a bit different than what we’re used to, but it’s really very simple. A post can go through numerous statuses. It can be a draft, it can be private, published and so on. There are also a lot of potential post types, such as “Post� and “Page,� not to mention that you can create custom post types. This hook simply enables us to put a status and a post type together and then get the hook that runs when that post’s type changes to the indicated status. So, our hook will be called publish_post.

add_action("publish_post", "my_awesome_publication_notification");

function my_awesome_publication_notification($post_id) {
	$post = get_post($post_id);
	$author = get_userdata($post->post_author);

	$author_email = $author->user_email;
    $email_subject = "Your article has been published!";

	ob_start();

	include("email_header.php");

	?>

	<p>
		Hi, <?php echo $author->display_name ?>. I've just published one of your articles
		(<?php echo $post->post_title ?>) on MyAwesomeWebsite!
	</p>

	<p>
		If you'd like to take a look, <a href="<?php echo get_permalink($post->ID) ?>">click here</a>.
		I would appreciate it if you could come back now and again to respond to some comments.
	</p>

	<?php

	include("email_footer.php");

	$message = ob_get_contents();

	ob_end_clean();

	wp_mail($author_email, $email_subject, $message);

}

By now, this should be second nature to you. The only real difference here is that we have to retrieve the data of the post, and the author’s data on lines 4 and 5, so that we have the necessary data for the email.

One thing you might be wondering is how I know that my function takes the ID of this post as its argument. I cannot freely choose this value, of course; it is dictated by how WordPress is built. Every hook supplies different arguments; some even supply more than one. To find out what arguments are at your disposal, you will have to go into some core files.

I suggest browsing the hooks database, clicking on the hook that you need, and then clicking on “View hook in source� next to your version of WordPress (preferably the latest one). Once there, scroll down, and find the highlighted line, which is where the hook is called. It will be in the form of do_action( $tag, $arg_a, $arg_b, $etc ) or apply_filters( $tag, $arg_a, $arg_b, $etc ).

Extending Our Functions

Interestingly, the wp_mail() function itself is a pluggable function, so you can completely override how it works. This may be going a bit over the top, but if you need some serious email-sending power (for example, you want a system that notifies your 120,000 registered users about new posts), you can completely modify it to use your mass-mailer application.

Because we are using a template for email headers and footers, a lot can be done to extend our emails. We can distinguish between emails to staff and emails to users by using different header files; we can add the latest three posts to the bottom of each email by using footer templates; and so on.

We can add a table to our database that holds information about which users are emailed the most, who responds to emails, and so on. Whenever you plug a function into something, it can contain any sort of code you’d like. You could include code for increasing the email count for user #112 inside the function that sends them the email, for example. This is not a good practice (you should create separate functions and plug them both in), but getting to grips with the vast power that this methodology offers is important.

A Word Of Warning

While the method described here is great, I am not an expert in creating HTML emails. The code for the HTML email above is tested to work in Gmail and some other applications, but each email application handles email differently. Some strip out all CSS, some strip out just background colors, and so on.

Before using the template, please test it with the most common applications (Gmail, Yahoo Mail, Apple Mail, Outlook, Entourage, Thunderbird, etc.) to make sure it works as expected.

Conclusion

Hopefully by now you have learned how to modify the emails that WordPress sends out, how to create your own emails, and how to plug them into different actions.

I also hope that your knowledge of WordPress hooks has expanded, because they are the tool for creating great plugins and add-ons for WordPress, and the thinking behind them is a glimpse into the world of object-oriented programming.

If you have any questions or comments, let me know: I am at your disposal. Also, if you’ve created a similar system, do share your thoughts, I would be happy to hear how you’ve accomplished the same, or better!

(al)


© Daniel Pataki for Smashing Magazine, 2011.


Web Usability: Top 10 Tips

With bounce rate and time-on-site assumed to be the top trump cards in Google’s new algorithm; there is most certainly a push from Google — and subsequently advertisers — for websites to become more user, in addition to search engine, friendly. Read on to find our top ten tips for enhancing the user experience including everything from Search Engine Optimization (SEO) and rich media, to navigation and mobile device optimization.

1. Faster is always better.
It is not a newsflash that speed and load times rule the web. Every second a user has to wait, the more likely they are to leave your site. If you’re experiencing some lag time, try reducing the number of HTTP requests by simplifying the design, using CSS and CSS Sprites, combining images into a single file, and reusing elements — like page headers — which can reload from the cache. You can also create the illusion of speed by placing style sheets in the header. This will allow the header and navigation menus to load first thereby showing progress and pacifying user impatience.

2. Simply site navigation.
The foundation to every webpage is the sitemap and navigation. Clear and concise menus are essential as well as a single page showing all links. Online reading patterns lend themselves to the typical “F” pattern (example below). To ensure that the user can easily interact with your content, keep a relatively short list of menu option down the left side and across the top. Be sure that all navigation info stays above the fold and that the logo links back to the homepage. Intuitive navigation outlasts number of clicks, so go ahead and forget about that 3-click rule. Not to imply that the user will stick out a lengthy path, but ultimately clicks don’t cause user frustration, poorly organized sites do.
Example of F shaped reading pattern

3. Embed Rich Media
Tickers, videos, animation and other rich media options have changed the landscape of the web and help keep the user on your site for longer while they interact with more content options. Nowhere is this more valuable than on education, news and entertainment sites. The biggest hurtle to overcome with rich media embeds is software compatibility. Consider using a third-party hosting site like youtube.com and embedding the video directly on your site. This will level the compatibility playing field and remove the server-hosting burden from you.

4. Optimize for Mobile Devices
While designing (or redesigning) your site, the need to factor in mobile devices is pressing. There are several schools of thought regarding site optimization, but the most all-encompassing and user-friendly option is to simply use the same URLs as the standard website. Strip down the site content to only the bare essentials. Simplicity is of the name of this game. Avoid using scripting languages or Flash components, as most devices are not equipped to support them. Keep in mind the small screens and use small graphics or ads and content that are scalable.

5. Bookmarking
Listing your site on social bookmarking websites like Digg can drive quality traffic to your way and bump your page views. It can also have a cascade affect where a user will tag your site for yet another site where yet another user will tag it again, and so on. Bookmarking is a handy tool that is relatively easy and doesn’t require a ton of time to achieve.

6. Utilize Social Media links.
Social media sites have taken over the way users share information with one another. Give viewers an easy way to link content they like from your site to their profiles. Not only will it spread the word, it will also get the attention of like-minded users who will not only click out of curiosity, they will probably spend quality time on your site which will help bolster your chances in the search engine pool.

Examples of Social Media Icons


7. Clearly Identify and Brand.

Brand identity is essential in all forms of media, but is most important on a large and complex website. Be sure the company’s logo or name is clear in the header. Choose, colors, fonts and graphic treatments compliant with brand style guides and reinforce that look at every opportunity. The more comfortable the user is with the style, the more familiar they are with the brand and are more likely to come back time and time again.

8. Search Bars are Essential
The more complex the site, the more essential the search bar . For user ease, stick to the tried and true method with an input field and a “submit” or “go” button located at the top, right of the page. Design the search bar cleanly with the font and color style already established for the overall look. In regards to search fields, less is more. Take Google for instance (see below), their entire brand is built upon the search bar and it remains simple and straightforward.
Example of Google Search Field

 

9. Strategically use Keywords and Titles
Be true to your content. Of late, Search Engine Optimization (SEO) has been all the rage, but don’t sell your digital soul for a few extra clicks. Google is working hard to filter and outsmart spammers who abuse the algorithm. Instead of getting caught up in the hype and fortifying your site with endless keywords, focus on how the user would look for your information and what words they might use. Be strategic in your keyword choices and get to the kernel of the matter to effectively garner the largest audience who will also spend the most time looking through your content.

10 Design. Design. Design.
Place big, attention-grabbing headlines above the fold, but don’t be overly concerned about making a user scroll. If you’ve successfully filled your site with quality content that is organized and clearly designed, scrolling won’t deter a user. The presentation of information requires a designer’s eye to ensure a site that is both aesthetically and functionally sound.

The post Web Usability: Top 10 Tips appeared first on Design Reviver.


Freebie: Organic Vector Elements in EPS (80 Vector Files)





 



 


Today we are delighted to release another freebie for our design community. This set contains over 80 original high quality vector files designed by the team at Vecteezy. These masterfully created, hand drawn organic elements are saved as Illustrator 10 EPS files and are perfect to add a touch of nature to any design project. The set includes items like swirly vines and weeds, Hawaiian flowers, Japanese cherry blossoms, butterflies, and much more!

Organic Vector Elements

Download the Collection for Free!

The elements contained in this collection are free for personal and commercial use. Please link to this article if you want to spread the word or give it a tweet or share it on Facebook! You may modify the file as you wish but please do not redistribute them elsewhere without written permission from Smashing Magazine and Vecteezy.

Free Vector Art

Free Vector Art

Behind the Design

As always, here are some insights from the designer:

“By nature, Web design is a decidedly “indoorsy” activity. Maybe that’s why we love opportunities to work with the organic! This vector set allows you to design with nature’s paintbrush. Inspired by some of our favorite parts of the great outdoors, these elements will add a natural feel to your projects.

We don’t always have the privilege of walking through a sunny meadow or feeling fallen leaves crunch under our feet. But hopefully these organic vectors will bring a bit of that serenity indoors and allow you to add a touch of nature to your next design project. Enjoy!”

Thank you, guys. We appreciate your work and your good intentions!

(il) (vf)


© Smashing Editorial for Smashing Magazine, 2011.


Adobe Illustrator Tutorial: Create a Christmas Greeting Card


  

Today’s Adobe Illustrator tutorial will walk you through creating a nice greeting card for the upcoming Christmas holiday. In order to create nice, colorful presents to stuff a Christmas sock we will combine different kinds of tools, such as; the Pen Tool, Mesh Tool, Ellipse Tool and the Rectangle Tool.

Besides that we will have the opportunity to mix and match some vivid colors and gradients in order to create a catchy illustration to suit our needs. We will have a great fun exploring some nice techniques during the creation process. So, get ready to create a nice Christmas illustration.

This is how the final product will look.

Creating the Sock

For the basic shape of the Christmas sock we will be using a Pen Tool (P). Grab it from the Tool Panel and try to draw the shape of a distorted sock. Don’t forget, the sock looks little bit distorted because it is full of presents. Feel free to experiment with the shape, trying to achieve the look like there is actually something inside the sock.

To achieve the look of a distorted Christmas sock full of presents we will be using a Mesh Tool. It will allow us to play around with the shape of the sock by creating interesting shadows and highlights.

Grab the Mesh Tool (U) and start adding the anchor points. You don’t have to add all anchor points at once. After applying the colors you’ll be able to see the illustration more clearly and to decide whether to add or remove some anchor points. All anchor points are editable. You can change their positions and the length of the paths between anchor points. While you are doing this think about all the fabric wrinkles you are intending to create.

After adding all the anchor points grab the Direct Selection Tool (A) from the Tool Panel and adjust the position of the anchor points and the angle of their handles. This way you’ll be able to change the position of the paths, which will affect the spreading of the colors which we’ve applied to a particular anchor point.

On the following pictures you can monitor applying colors process.

The animation below is showing the rest of the coloring process.

Feel free to adjust the position of all the anchor points after applying colors, if needed.

Creating the Upper Part of the Christmas Sock

Now we will try to create the fluffy upper part of the Christmas sock. To do that we will use the Arc Tool.

Grab the Arc Tool from the Tool Panel and click somewhere on the Artboard. In the Arc Segment Tool Options box just hit the Ok button (don’t change anything).

Set the Stroke color to white #FFFFFF and make sure to create many copies of the path. Move them around to form the fluffy part of the sock. You should end up with something like this.

Place the fluffy part we have just created on the top of the sock.

Creating the Presents

In this part of tutorial we will create the elements to ‘fill’ the Christmas sock with. First we will create the Christmas ball.

For the basic shape of the Christmas ball we will be using the Ellipse Tool (L). Holding the Shift key on the keyboard create a circle.

Let’s apply a nice radial gradient to our circle. Feel free to use any color combination you like. We will use a nice purple gradient.

Grab the Rectangle Tool (M) from the Tool Panel and create a rectangle as it is shown in the picture below. Use the same radial gradient we have used in the previous step.

We will need to use the Rectangle Tool (M) one more time for the top of the Christmas ball. Create another rectangle, a bit larger, but make sure to make the upper part of the rectangle a bit curvy. To achieve that just grab the Direct Selection Tool (A) from the Tool Panel and pull the handles of the endpoints upwards, as it is shown in the picture below. This will create a nice curvy side of the rectangle.

Now grab the Ellipse Tool (L) again and create a circle. Holding the Alt / Option key on the keyboard click on the circle and drag it to the right. It will create a copy of the circle. Don’t forget to hold the Shift key on the keyboard for the straight dragging. Repeat this step four more times.

In order to create an equal distance between the circles select them all and under the Align Panel hit the Horizontal Distribute Space. You should end up with something like this.

Select the blue shape and one of the circles and under the Pathfinder Panel hit the Minus Front button. Repeat this step with the rest of the red circles.

You should end up with something like this.

Now, grab the Ellipse Tool (L) from the Tool Panel and create another circle. Remove the Fill color and set the Stroke color to any color you like. Set the stroke to 4pt.

Let’s apply some nice golden gradients to the upper part of the Christmas ball . This will give our ball a fancy look. But first we have to turn the red circle into an editable path. Select the red circle and under Object select Expand and send the ring to the back (Shift + Ctrl / Cmd + [). This way we will hide the lower part of the ring we actually don’t need.

In the following pictures you will find the information about applying a golden, linear gradient.

For the handle of the Christmas ball use the same linear gradient, just move gradient more to the left (to do that, select the Gradient Tool (G) from the Tool Panel and after applying the gradient grab the slider and move it to the left).

Duplicate (Ctrl / Cmd + C, Ctrl / Cmd + F) the handle twice and nudge one of the copies 1 pixel down and to the left. Select both copies and under the Pathfinder Panel hit the Minus Front button (just make sure that the nudged copy is below the copy we didn’t move).

You should end up with something like this.

Ungroup (Shift + Ctrl / Cmd + G) the new shape and delete the lower part. Under the Gradient Panel make sure to click on the Reverse Gradient in order to change the color order inside the gradient.

This way we’ve created a depth for the handle. Just make sure to place the new shape behind the golden handle. You should end up with something like this.

Now we have to do something with the part of the Christmas ball between the actual ball and the upper part. You will all agree that it shouldn’t be left like that.

One of the things we might do is to hide it with a nice blue bow. There are many different ways to create a nice bow. Just use your imagination and try to be creative.

Grab the Pen Tool (P) from the Tool Panel and draw the shapes as shown below.

These are the basic shapes we will need. With some nice gradients and additional shapes we will create a nice blue bow that will help us complete our Christmas ball.

Use the radial gradient for the knot. We will try to emphasize the upper part of the knot with the light blue color.

Use the same radial gradient for the inner part of the bow as well.

Select all the elements besides the knot, and under Object select Transform > Reflect. Set the Axis to Vertical and hit the Copy button. Scale down the copied elements a bit and adjust the angle and the position, just like in the picture below.

Now we have to add some details in order to make the bow more interesting.

First, we will create a thickness for the fabric. For each part of the bow use the same technique.

Duplicate (Ctrl / Cmd + C, Ctrl / Cmd + F) the shape twice that you want to give some thickness. Nudge one of the copies 1 pixel (downwards, upwards, right or left, depends on the position of the shape). Select both copies and under the Pathfinder Panel hit the Minus Front button. In the picture below you can see the improvement we have achieved with this technique.

There is one more thing we can do. We can create some nice yellowish stripes which can make our bow even more interesting.

Grab the Pen Tool (P) from the Tool Panel and create a curved paths as is done in the picture below.

It might look a little bit confusing like this but in the next few steps we will make it more clear.

First we need to turn the paths into editable shapes. To do that, select them all and under Object select Expand.

Now we need to crop them. Duplicate (Ctrl / Cmd + C, Ctrl / Cmd + F) the blue shape underneath the red stripe. Select the copy we have just made and the red stripe and under the Pathfinder Panel hit the Intersect button.

Repeat this step for the other red stripes as well. You should end up with something like this.

And now we will apply a nice linear gradient to our stripes.

Repeat this step to complete the other stripes as well. Use the same gradient, just make sure to match the highlighted part of the stripe with the rest of the bow. Group (Ctrl / Cmd + G) all elements of the bow.

Place the bow on the Christmas ball, just make sure to hide the flaw the best you can.

Duplicate (Ctrl / Cmd + C, Ctrl / Cmd + F) the bow. Ungroup (Shift + Ctrl / Cmd + G) the copy and under the Pathfinder Panel hit the Unite button.

Set the Fill color of the new shape to #4C0230, rotate a bit, move around and make sure to place it underneath the actual bow.

Select the basic shape of the Christmas ball and duplicate it (Ctrl / Cmd + C, Ctrl / Cmd + F). Select the copy we have just made and the purple shape of the bow and under the Pathfinder Panel hit the Intersect button. It will create the shape of a shadow that the bow is casting on the Christmas ball.

Creating a Candy Cane

Grab the Ellipse Tool (L) from the Tool Panel and create a circle. Remove the Fill color and set the Stroke color to any color you like.

With the Direct Selection Tool (A), select the bottom Anchor point and hit the delete key on your keyboard. You should end up with something like this.

Now select the Line Segment Tool (/) and draw a vertical line. Select both objects and in the Align Panel hit Horizontal Align Right.

Hit the up arrow on the keyboard until the vertical lines meet the arc. With the Direct Selection Tool (A) select the end points of both paths and under the right click select Join.

Now we need to set the thickness of the candy cane. Set the Stroke to 50 pt and under the Stroke Panel hit the Round Cap button. It will make the endpoints of the Candy Cane round.

Under Object select Expand in order to turn the Candy Cane into an editable shape. You should end up with something like this.

Creating the Stripes

This part of the creation process is quite simple. All we have to do is to create white and red stripes and to make sure to make them look as though they curve around the Candy Cane.

Grab the Arc Tool and click somewhere on the Artboard. It will bring up a dialog box like this.

Do not change the settings in the Arc Segment Tool Option box and hit the OK button. It will create an arc. Rotate it and place it as it shown in the picture below.

Holding the Alt / Option key on the keyboard click on the arc and drag it upwards (don’t forget to hold the Shift key on the keyboard for the straight dragging). Feel free to rotate some of the arcs if needed. Repeat this step until you get something like this.

Select all the elements and under the Pathfinder Panel hit the Divide button. It will divide our Candy Cane into the small segments whose colors we’ll change to white and red.

Ungroup (Shift + Ctrl / Cmd + G) the candy cane and get ready to apply some nice linear and radial gradients.

Applying Color Gradients to the Candy Cane

We will try to achieve a semi-realistic look by using some very nice color gradients. The most important thing is to highlight the middle part of the Candy cane. This way we will simulate the oval look of the cane.  For curved parts of the candy cane we will be using a radial gradient.

To the white parts of the candy cane we will apply a gray – white – gray linear gradient.

Apply the same gradient to the other white parts of the candy cane as well. For the curved part use a radial gradient with the exact same colors.

You should end up with something like this.

Let’s do the same thing for the red parts of the candy cane. Apply a red linear gradient for the straight parts of the candy cane, and a red radial gradient for the curved parts.

Our candy cane is done. We can add a small detail like a colorful bow to make it look more interesting.

Next Stop: Mistletoe

Christmas wouldn’t be Christmas without a little mistletoe. This is the reason why we will include it in our illustration. The creation process is quite simple, all we have to do is create a few berries and some nice green leaves.

Let’s start with the leaves. For the shape of the leaf we will be using the Pen Tool (P). Try to draw the shape as shown below.

Remove the Stroke color and apply a nice green linear gradient.

Let’s “divide� the leaf. Grab the Ellipse Tool (L) from the Tool Panel and create a small circle. With the Direct Selection Tool (A) select the lower anchor point of the circle, and holding the Shift key on the keyboard drag that anchor point downwards (we are holding the Shift key for the straight dragging). In order to create a sharp corner, grab the Convert Anchor Point Tool (Shift + C) from the Tool Panel and click one the lower anchor point.

Grab the shape we have just created and drag it to the Brush Panel. In the New Brush dialog box select Art Brush and hit OK.

Make sure to set the Colorization Method to Tints. This way we’ll be able to change the color of the brush without expanding the brush.

Now we have created a brush that we’ll apply to some paths. Grab the Pen Tool (P) from the Tool Panel and create few paths, just like it’s shown in the picture below.

Now apply the brush, that we have created in the previous step, to each individual path. Adjust the position of the anchor points, adjust the stroke if needed and set the Stroke color to #8DC63F.

Select the shape of the mistletoe and under Object select Path > Offset Path. Set the value for Offset to -4.

Select the middle path we created in the previous step and duplicate it (Ctrl / Cmd + C, Ctrl / Cmd + F). Grab the Direct Selection Tool (A) from the Tool Panel and move the end points as it is in the picture below. This way we’ve created a path that will help us divide the smaller shape of the mistletoe.

Select the new path and the smaller shape of the mistletoe and under the Pathfinder Panel hit the Divide button. It will divide our shape in half.

Ungroup (Shift + Ctrl / Cmd + G) the new shape and apply some nice color gradients to the right side of the mistletoe.

We will use the left part to create a smaller shape. Select it and under Object hit Path > Offset Path. Set the value for Offset to -4.

Delete the larger part of the left side and apply the color gradient.

Select all elements of the mistletoe leaf and Group them (Ctrl / Cmd + G). Grab the Rotate Tool (R) from the Tool Panel and holding the Alt / Option key on the keyboard click underneath the leaf. Set the value for Angle to 120 degrees and hit the Copy button.

To create another leaf rotated for another 120 degrees simply hit the shortcut on the keyboard Ctrl / Cmd + D.

As far as the mistletoe leaves are concerned we are done. Now we have to create some berries.

Grab the Ellipse Tool (L) from the Tool Panel and create a circle (hold the Shift key on the keyboard to create a circle). Apply a red radial gradient.

With the Ellipse Tool (L) create two ellipses and apply darker radial gradients, like it is shown in the image below.

Group (Ctrl / Cmd + G) all the elements of the berry, create three copies of the berry and place them on the leaves. Scale down some of the leaves and berries and rearrange them until you reach a desirable result.

Now Group (Ctrl / Cmd + G) all of our elements for the Christmas sock (Christmas ball, candy cane and the mistletoe) and place it “in� the sock. Adjust the position and the angle of the elements as needed.

With a nice floral background and some additional details and shadows you can turn your illustration into a nice Christmas greeting card. Voila!

Conclusion

As you can see, the creation of the Christmas greeting card can be great fun. Christmas is an amazing holiday characterized by many wonderful motives and elements. There are numerous things you may create; snowflakes, gingerbread, presents, snowmen, etc. The creation of these elements require the use of different kinds of techniques, but all together you are making a catchy illustration which can be used for many different purposes.

This time we’ve had the opportunity to practice again with the Mesh Tool. For more practice feel free to visit the Halloween ghost tutorial where you can find some additional information regarding this useful technique. It may seem that the Mesh Tool is complicated to use, but actually it’s not. Even when the illustration is finished it is possible to make minor or major changes in order to make improvements.

If you happen to have any questions feel free to post them in the comment section below. Hope you like the tutorial. Thank you for following along.

(rb)


The Role Of Design In The Kingdom Of Content





 



 


If content sits at the top of the food chain, why do we spend so much time talking about the finer points of design? Every day we debate, experiment with and discuss topics that easily fall into the category of aesthetics, enhanced functionality and layout; in fact, relatively rarely do we talk about content. Nevertheless, even though we should concede that content is king in this realm, this doesn’t mean that design should be devalued.

It may seem logical that the user experience lives and dies by how the user relates on an emotional level to the content on a website. But this is not necessarily the case. From a design perspective, our job is to maximize the value of every visitor, whether they love the content or hate it. The role of a UX designer is not always to make everyone feel all warm and fuzzy inside. A rich Web experience could include the emotion of happiness, humor, discontent, sadness, anger or enlightenment. A well-designed website enables us to attribute our emotion to its source and connect us to that environment through a range of senses. A UX designer should understand why and how to utilize the principles and techniques they have learned to support the website’s precious content.

Justifying User Experience Design

Investing in UX design as an amplifier of good content is not always an easy process. In many industries, a product that fills a demand and that works as it should is good enough. Most of us don’t care how an ink pen or a computer monitor makes us feel, as long as it works. A large portion of the Web still reflects this sentiment, as do clients and project managers who haven’t been educated in the value of UX.

A website is a much more involved product than an ink pen and calls for a different measurement of user satisfaction. A product that merely meets demand and works correctly does not suit a medium that is so highly interactive and saturated. As designers, our task sometimes is to convince other parties of the value of building a user’s personal engagement with the website’s content. Fortunately, we have examples of companies that have done UX right and that have the success to show for it.

As a geek who enjoys building computers, I look to Newegg as a good example of a company that has played to its strengths to deliver a superior user experience. In its early days, Newegg’s fair prices and lightning-fast delivery of computer components made it the place to shop for IT people. This was all great, but the real kicker was that users who loved to share product strengths and weaknesses with each other could do it all on Newegg’s website.

This turned out to be a fantastic benefit for new users, who were inclined to trust the experience and suggestions of people they regarded as peers. As a result, Newegg built a massive army of geeks who generated content and provided an extremely valuable experience to its users. If you had a device or component that was functioning oddly or not at all, chances are that someone had shared the cause and maybe even a solution in a Newegg review.

Newegg

Newegg acted on this opportunity the right way by using design to highlight its most valuable content. While its design may not be the slickest or most modern, Newegg provides a great experience and has high user satisfaction. Ratings and reviews by peers have become a driving force in Newegg’s design and populate nearly every page. As the design has evolved over the years, product reviews have floated to the surface of nearly every page, and the system for contributing reviews has grown in depth and functionality as well. Newegg even took this to the next level with a recent nationwide ad campaign and design. All of this came about because Newegg identified which of its content made for a strong user experience and built on it, which should be done in every Web project.

Identifying the content that makes you stand out is only the first piece of this puzzle. What we really want to explore is how to take everything we have learned about color theory, lines, shapes and visual movement and apply it to our content in a way that doesn’t just decorate it or even make it pop on the page, but rather that supports the conversion of a goal or delivery of a message. Much like how the primary function of petals on a flower is to attract insects to pollinate, good design ensures that your website will thrive. All of that great design talent needs to be applied not only to the content but to the layer before and after it as well.

The Delicious Design Sandwich

With virtually every website, good UX design can be sectioned into three parts or events: introduction, consumption and reaction. Content is at the core, the meat of what the user is looking for, and on both sides of the content are events that are driven by a well-executed design.

User Introduction

The Web is a world of first impressions, and quick ones at that. Users form an opinion of a website within the first few seconds of loading it. This means that the colors, the layout and the presentation of headings are all evaluated before any content is actually absorbed. Users are inclined to scan content until they zero in on something that piques their interest. Regardless of what your content actually says, the design around it controls what the users see first and how their eyes move across the sections of the page.

In addition to searching for interesting information, users will also be determining how credible this resource is. Despite being constantly taught that we shouldn’t judge a book by its cover, all of us are susceptible to trusting a resource based on our familiarity with it, what our peers think of it and the time and money that we estimate was put into its construction.

Living Social takes advantage of this in its design in multiple ways. A quick scan of the main page after the user has entered an email address and location reveals several techniques that have been implemented to elicit a reaction from the user.

Living Social

Perhaps most striking is the background image. In every city that Living Social serves, a background picture loads that the visitor can relate to. I immediately connected with this website because I did a double-take at the background image and realized that I pass by this area all the time: it’s just down the road from me!

Living Social has also done the little things right. A clear hierarchy is established on the page through the headings and content modules; the call to action is the most prominent element; and the interactions oriented around engagement are easily accessible. The counters that tell you how many people have bought the deal and how much time you have left generate sufficient peer pressure.

Living Social

When all is said and done, Living Social has invested in the introduction side of its design, which makes a lot of sense given its content. Living Social and the other daily deal websites thrive on a high volume of quick visits, which means they often live and die on first impressions. The heavy emphasis on the impression portion of this design begins with the content. Instead of fitting content into a design concept, Living Social has wrapped an appropriate design around the content that it wants to feature. But we aren’t done there.

Content Consumption

Even in the process of consuming content that we’ve proposed, design plays a huge role. The crucial rules of typography control the experience that users have when reading articles. The mood of images and video can vary drastically based on their aesthetic setting. If your primary content is user-generated, then the ability of users to interact with the website and each other will be driven by the interface you’ve designed.

More than anything else, content is an opportunity to set the tone of the website. We have all witnessed the untold damage that is done when content that should have a professional tone is set in Comic Sans. The font face, size and color can do an amazing job of controlling how your website says something that leaves an impression on users, which leads to the final piece of our sandwich. Along these lines, the way you frame entire portions of the website gives the audience clues as to what their emotional reaction should be.

We see this naturally develop with websites created by designers for their own peers. Portfolios, design-related apps, and websites for networks and conferences are all designed for tone. Of course, getting too extravagant in an attempt to impress is the opposite of what we are trying to achieve here. However, in the case of a conference about HTML and CSS, a website that experiments with the edges of what’s possible with HTML and CSS is an appropriate setting for the content.

The Combine

Like many websites for technology and design conferences, The Combine in Bloomington, Indiana, is highly design-driven. In addition to the slick HTML and CSS that will resonate with the professionals being targeted, the aesthetics intentionally reflect the small-town atmosphere of Bloomington. The same features that distinguish the location of this conference also encourage users to identify with the design.

User Reaction

This may be the most understated design-driven activity on a website, but it carries huge value. How the user responds to your content is pivotal to the website’s success. These days, merely delivering content is not enough. The Web has a wealth of information and options. In order for a website to enjoy any success, it must take advantage of referrals, links and maybe a bit of buzz on social networks. If we want to stand out on the Web, our users need to share our content with friends or contribute their own thoughts, reactions and content.

YouTube serves as a practical example of building an experience around the user’s reaction. YouTube kickstarted the concept of viral videos, but getting there required that the website be designed around the content itself. We all know that a massive amount of content is uploaded to YouTube every day, but the degree to which a video goes viral depends on how encouraged the user feels and how easily they are able to share or contribute to the experience.

YouTube

It doesn’t take a trained eye to see this in action all over any given YouTube page. Suggested and related videos are always available, along with the option to share a video on your favorite social network or embed it anywhere on the Web. Of course, the design was not made to look good on its own and then this functionality shoehorned in. Again, the emphasis is on the content, and the design elements that result in the user’s reaction are all rooted in sharing or exploring that content.

In a world driven by likes, tags, tweets, shares and votes, the follow-through that a website and its content facilitates becomes a massive factor in its success or failure. A user who visits a website, views the content and then leaves generates little value for the business. For this reason, we see blog articles sprinkled and even littered with related content, suggested videos that come up after you watch a clip, and quick and easy share and save buttons everywhere. The follow-through on each of these actions is highly design-driven. The color, shape, size and location of links and buttons determine whether a visitor sees them quickly or not. But, of course, we can’t expect everyone to play the role that we define for them…

Designing For An Experience

As important a role as design plays in the perception of and reaction to your content, people still argue that a user experience cannot truly be designed. Of course, the user ultimately decides how they engage with any design. If the goal of a design is to convert every single user into a customer, then failure is the only outcome. We can, however, design an experience that connects immediately with a target audience, delivers information with a clear tone and purpose, and encourages a response.

We want to design an experience for users who are willing to buy into it. Users come to your website most likely because they already have some interest in digging into the content, which means they are willing to play into the experience that you have designed. If a user stumbles on the website by mistake, then taking them all the way to the reaction stage of the experience becomes more of a bonus than a goal.

Different techniques for driving engagement with content can be found across the Web. If you’ve been to the blog xheight lately, you may have noticed its effort to prioritize the content in its posts. In addition to the minimalist design, the designer further isolates the content by fading elements out of view after your cursor has been idle for a few moments, leaving the article you are reading as the only element on the page.

X Height Blog Before

X Height Blog After

The jury is still out on whether this makes for a better or more distracting reading experience, but this design decision clearly centers on the content that the designer wants to deliver.

A different technique is apparent on the Livestrong website. When the user hits the browser’s address bar or tries to click away after reading an article, a modal window with related content pops up. It’s interesting that the modal window is enabled only in the blog section of Livestrong, and not by mistake. With a website this rich in content and from so recognizable a brand, the designers could assume that the majority of traffic to these articles would come from search engines. The goal here is to keep users from jumping back to Google for more content and to have them continue engaging with the content here.

Livestrong

Keep Designing

Now as much as ever, companies are recognizing the value that good design and a solid user experience can bring to them. UX design is about developing a road map for the user, encouraging certain actions, and developing a user base that wants to engage with your content.

The key to driving this engagement is to ensure that we value design in the right way, not simply as a template, theme or color scheme but as a support system for key content. We can use design to make a website unique and more memorable. We do this by laying the foundation of a good impression, enabling smooth and meaningful consumption, and encouraging engagement with the content. All three of these areas are opportunities to drive a user experience that is in harmony with our content.

Additional Resources

(al)


© Jason Gross for Smashing Magazine, 2011.


  •   
  • Copyright © 1996-2010 BlogmyQuery - BMQ. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress