Archive for October, 2011

Mustache, ERB and the future of templating

There are days that I feel like I’ve spent the better part of my life inside templating languages. I’ve rocked hundreds of different styles of templates over the past 8 years. Smarty, vBulletin templates, generations of Wordpress, J2EE, XSLT, CFML, ERB, HAML, Mustache and every form of in-house bastardized template language that exists.

So when I say that {{ mustache }} is my favorite templating language I’ve ever worked with, I mean it with a great deal of sincerity and experience. It’s syntactically elegant, focused on output (HTML), encourages documentation, and discourages unmaintainable magic. I want to use it everywhere.

I mustache you, why mustache?

-"Mustache

Mustache is more than a syntax. It’s a different approach to traditional templating — mustache templates have no logic. The template files themselves are HTML and mustaches:

<table class="devlist">
  {{#developers}}
  <tr>
    <td class="name">
      <h4><a href="{{ show_url }}">{{ name }}</a> <em>({{ github_username }})</em></h4>
      <p class="languages">{{ languages }}</p>
    </td>
    <td class="location">{{ location }}</td>
  </tr>
  {{/developers}}
</table>

You cannot modify variables. You cannot apply filters. You can only output variables or a collection of variables. Everything else happens inside of a view. A view can be written in any language of your choosing: C, Objective-C, Ruby, Python, Javascript, etc. I’ll use Ruby since that’s what we use:

module Jobs
  module Views
    class Developers < Layout

      def developers
        @results.entries.map do |hit|
          name = hit["fullname"].empty? ? hit["username"].capitalize : hit["fullname"]
          {
            :name => name,
            :github_username => hit["username"],
            :location => hit["location"],
            :show_url => '/developers/' + hit["username"],
            :languages => hit["language"]
          }
        end
      end

      def developers_count
        @results.total_hits rescue 0
      end

    end
  end
end

It’s just a good old Ruby class. Oh the wonder you can do with a class! Include modules, extend classes (such as that Layout class), and define any method you so desire. With any documentation your heart desires (something that’s missing from every templating strategy I’ve ever used).

I thought I loved Mustache a year ago, but over time I’ve learned just how revolutionary separating templates from views is toward maintainability and collaboration. Anyone who knows HTML can edit Mustache templates. And all the magic that happens on the whole V side of MVC can be fully documented and separated into re-usable Ruby classes and modules.

You want me to switch templating languages on my legacy app?

For all this talk, the application I spend most of my time working on is still ERB. In fact, the rails app that powers GitHub has over 500 erb templates. We have dozens of people throwing hundreds of commits a day at the codebase in over 150 branches. Switching to Mustache would be a disaster requiring everyone to stop development, switch patterns, and introduce an unknown number of bugs to our customers. A shitty trade.

I don’t want to stop new feature development, but I do want better templates. And I know that Mustache is the direction I’d like to go. Luckily for me, I work with the smartest people in the world. A little while ago Simon introduced a new templating strategy that I really like.

Mustache-style ERB templates

We’ve started using the mustache style but completely within ERB — we haven’t modified the template rendering chain at all. Inside of a new helper, we’ll create a view class:

module NavigationHelper
  class RepositoryNavigationView
    include ActionView::Helpers::NumberHelper

    attr_reader :current_user, :current_repository

    def initialize(user, repo)
      @current_user = user
      @current_repository = repo
    end

    # What symbols should we trigger highlighting for various tabs?
    #
    # Returns an array of symbols.
    def highlights_for_code
      [:repo_source, :repo_downloads, :repo_commits, :repo_tags, :repo_branches]
    end

    def highlights_for_pulls
      [:repo_pulls]
    end

    def highlights_for_issues
      [:repo_issues]
    end

    # Should we show the wiki tab? We try and show it when it's useful to
    # someone using these rules:
    #
    # - Never show it if the wiki is disabled under the admin section.
    # - Show it if you have admin access to the repository
    # - Show it if there is content
    #
    # Returns true to show the tab.
    def show_wiki?
      return false unless current_repository.has_wiki?
      return true if logged_in? && current_repository.pushable_by?(current_user)
      current_repository.wiki.page_count > 0
    end

  end
end

Nicely documented, isolated from application-wide helpers and easy to find. Inside of the html.erb, create a new instance of this view object:

<% view = NavigationHelper::RepositoryNavigationView.new(current_user, current_repository) %>

<% unless @omit_repository_toolbar %>
  <ul class="tabs">
    <li><%= selected_link_to "Code", code_path, :highlight => view.highlights_for_code %></li>
    <li><%= selected_link_to "Network", network_path, :highlight => view.highlights_for_network %>
    <li><%= selected_link_to "Pull Requests", pull_requests_path, :highlight => view.highlights_for_pulls %></li>

    <% if view.show_issues? %>
      <li><%= selected_link_to "Issues", issues_path, :highlight => view.highlights_for_issues %></li>
    <% end %>

    <% if view.show_wiki? %>
      <li><%= selected_link_to "Wiki", wikis_path, :highlight => view.highlights_for_wiki %></li>
    <% end %>

    <li><%= selected_link_to "Stats &amp; Graphs", graphs_path, :highlight => view.highlights_for_graphs %></li>
  </ul>

  <%= render_subnav 'repositories/code',        view.highlights_for_code %>
  <%= render_subnav 'repositories/network',     view.highlights_for_network %>
  <%= render_subnav 'repositories/graphs',      view.highlights_for_graphs %>
  <%= render_subnav 'repositories/wiki',        view.highlights_for_wiki %>
<% end %>

If you’re used to regular ERB templates it’s immediately obvious where this data comes from — it’s right at the top of the file! Ack the project for RepositoryNavigationView and you’ve found your view class. No magic.

One huge advantage of this tactic is that you can still use all the same Rails/ERB shortcuts for quick prototyping. If someone doesn’t want to learn the new template strategy right away, they can use the same methods they’ve been using for years.

Graceful upgrade path

Switching templating languages is something that needs to be done gracefully when you’re working with others. Ripping out everyone’s foundation is a recipe for unhappy developers. Rails is all about patterns, and sticking to those patterns is really important.

This strategy allows us to slowly convert the codebase to a better documented, view/template separation that anyone who’s worked with ERB can understand. And if we choose to switch to true-and-blue Mustache some day, our code will be 80% there already.


Advanced Layout Templates In WordPress’ Content Editor





 



 


As a Web designer, I often find myself building WordPress-based websites that will ultimately be updated and maintained by clients who have little to no experience working with HTML. While the TinyMCE rich-text editor is great for giving Web content managers of any skill level the tools they need to easily style and publish their posts to a degree, creating anything beyond a single column of text with a few floated images generally requires at least a basic understanding of HTML.

multi-col-layout-featured

This article shows you an easy-to-implement trick that enables even the least tech-savvy of clients to manage multi-column content layouts within the comfort of the WYSIWIG editor. And for you advanced users, it’s still a great way to standardize and streamline your content entry.

Creating A Custom Layout

All we’re really going to do here is inject a few HTML elements into the editing window and style them. WordPress’ default_content filter allows us to insert set content into any post as soon as it’s created so that our clients don’t have to. This filter is also great for adding boilerplate text to posts.

The Back End

By adding the following to functions.php, each new post we create will come pre-stocked with two divs, classed content-col-main and content-col-side, respectively. I should note now that this code has been tested only in WordPress version 3.0 and up:

<?php
   add_filter( 'default_content', 'custom_editor_content' );
   function custom_editor_content( $content ) {
   $content = '
      <div class="content-col-main">

      This is your main page content

      &nbsp;

      </div>
      <div class="content-col-side">

      This is your sidebar content

       &nbsp;

      </div>    
   ';
   return $content;
   }
?>

A couple of things to note:

  • The default_content filter is fired only when a new post is created; any posts or pages that existed before you added this code will not receive this content.
  • The line spacing and additional &nbsp; are not essential, but I’ve found them to be useful for preventing a few of TinyMCE’s little quirks.

Now we just need to give it some style. Add the following to functions.php:

<?php
   add_editor_style( 'editor-style.css' );
?>

The add_editor_style() function looks for the specified style sheet and applies any CSS it contains to the content in our TinyMCE editing window. If you don’t specify the name of a style sheet, it will look for editor-style.css by default, but for the purpose of this article, I’ve written it out. Create a style sheet named editor-style.css, and place it in the theme folder, with the following styles:

body {
   background: #f5f5f5;
}

.content-col-main {
   float:left;
   width:66%;
   padding:1%;
   border: 1px dotted #ccc;
   background: #fff;
}

.content-col-side {
   float:right;
   width:29%;
   padding:1%;
   border: 1px dotted #ccc;
   background: #fff;
}

img { /* Makes sure your images stay within their columns */
   max-width: 100%;
   width: auto;
   height: auto;
}

Now, when you create a new post, you will see two columns that you can type or paste your content into:

Example of a multi-column template in WordPress’ TinyMCE editor
This basic multi-column template will now appear any time you create a new page or post.

And there you have it: a simple multi-column template in your content editor. You can go back and edit the default_content and editor-styles.css to adapt the content layout to your needs:

Example of an advanced multi-column template in WordPress’ TinyMCE editor
Use this technique to create your own layout templates, customized to your content.

The Front End

When your post is displayed on the front end of the website, the content will still appear in a single column, as before. The styles you wrote out in editor-style.css do not get passed to the front end of the website. However, by viewing the page source, you’ll see that the divs we created with our custom_editor_content() function have been passed through and are wrapping the different sections of the content. Simply open style.css (or whatever style sheet you’re using for your theme) and style to your heart’s desire.

Example of a WordPress post designed with a customized multi-column layout
This technique applies not only to the visual layout of content. Use JavaScript to target specific containers to make on-the-fly slideshows and other dynamic effects.

Get More From Your Templates

Beyond just opening up new styling possibilities, this technique can also be used to create objects to target later with JavaScript.

Example of a WordPress advanced layout post using different sections for Javascript-enabled tabs

In the example above, we were able to turn a series of content areas into more easily digestible tabbed sections for the user, while still allowing the administrator to update all of the information on one page. These are just a few of the many ways you can take your WordPress templates further.

Templates For Templates

The code above will simply apply the same layout and styling to all of your posts, pages, custom posts… anywhere the TinyMCE editor appears. This is probably not ideal. By adding conditional statements to the custom_editor_content() function above, you can serve a different default layout template to each of your post types:

<?php
   add_filter( 'default_content', 'custom_editor_content' );
      function custom_editor_content( $content ) {
         global $current_screen;
         if ( $current_screen->post_type == 'page') {
            $content = '

               // TEMPLATE FOR YOUR PAGES

            ';
         }
         elseif ( $current_screen->post_type == 'POSTTYPE') {
            $content = '

                // TEMPLATE FOR YOUR CUSTOM POST TYPE

            ';
         }
         else {
            $content = '

               // TEMPLATE FOR EVERYTHING ELSE

            ';
         }
         return $content;
       }
?>

You can style all of your default content elements in the editor-style.css file, but if you’d like to use a different style sheet entirely for each post type, you can do so with this snippet from WPStorm:

<?php
   function custom_editor_style() {
      global $current_screen;
      switch ($current_screen->post_type) {
         case 'post':
         add_editor_style('editor-style-post.css');
         break;
         case 'page':
         add_editor_style('editor-style-page.css');
         break;
         case '[POSTTYPE]':
         add_editor_style('editor-style-[POSTTYPE].css');
         break;
      }
   }
   add_action( 'admin_head', 'custom_editor_style' );
?>

Add the above to your functions.php file, and then create the editor-style-[POSTTYPE].css files to use different style sheets for the corresponding post types. Just replace [POSTTYPE] with the name of your custom post type. Extend the code above by adding new cases for each additional post type.

Alternatively, you could use the following code to automatically look for a style sheet named editor-style- followed by the name of the post type that you’re currently editing. Again, just make sure that the suffix of the new style sheet you create matches exactly the name of the post type.

<?php
 function custom_editor_style() {
   global $current_screen;
   add_editor_style(
   array(
      'editor-style.css',
      'editor-style-'.$current_screen->post_type.'.css'
    )
   );
 }

 add_action( 'admin_head', 'custom_editor_style' );
?>

(In this snippet, editor-style.css will also be included on all post-editing pages, in addition to the style sheet that is specific to that post type, which will be named editor-style-[POSTTYPE].css.)

Conclusion

While this method does have its drawbacks — it assumes you already know the layout that your client wants to give their content, and the layout structures cannot be easily edited by the client themselves — it does enable you to create more interesting sandboxes for your client to play in, while encouraging a standardized format for the content.

If the client decides they don’t want to use a pre-defined container for a particular post, they can simply click inside the container and hit Backspace until all the content is gone, and then hit Backspace once more, and TinyMCE will delete the div wrapper, leaving a clean slate for them to work with.

I hope you’ve found this little technique useful. I’m excited to see all of the ways you guys will customize and improve it for more dynamic layouts.

Additional Resources

(al)


© David Hansen for Smashing Magazine, 2011.


The Do’s And Don’ts Of Infographic Design





 



 


Since the dawn of the Internet, the demand for good design has continued to skyrocket. From Web 1.0 to Web 2.0 and beyond, designers have remained on their toes as they define the trends and expectations of our online universe. The Internet is a great designer’s playground, and online businesses are growing more and more appreciative of what can be gained from a bit of well-executed eye candy. Over the past two years, this fact has become the backbone of a growing trend in online marketing: the infographic.

Infographics are visual representations of information, or “data vizâ€� as the cool kids call it these days. The term “data viz” comes from “data visualization,” which implies that sets of data will be displayed in a unique way that can be seen, rather than read. This visualization should not be left up to interpretation, it should instead be designed in a way that provides a universal conclusion for all viewers. In the simplest terms, infographics are not too different than the charts and graphs that programs like Excel have been spitting out for years.

Of course, just as Web 2.0 changed 1.0, today’s infographics are far more eye-catching than simple pie charts and bar graphs. Today, infographics compile many different data visualizations into one cohesive piece of “eye candy.” They have evolved with design trends, received some creative facelifts, and the Internet is now getting filled with interesting information delivered in enthralling ways.

While some design trends come and go, infographics are here to stay. With brands like USA Today, The New York Times and Google and even President Obama getting behind them, infographics are becoming a powerful tool for disseminating huge amounts of information to the masses. Companies large and small are using infographics to build their brands, educate their audience and optimize their search engine ranking through link-building. This is why learning how to design a good infographic is a must, and avoiding the common pitfalls of infographic design could mean the difference between landing a big client and losing them entirely.

Wrapping Your Mind Around Data Viz

Designing an infographic is not the same as designing a website, flier, brochure, etc. Even some of the best designers, with portfolios that would make you drool, cannot execute an effective infographic design. Creating infographics is a challenge and requires a mindset that does not come naturally to everyone. But that mindset can be gained through practice and by sticking to certain standards, the most important of which is to respect and understand data viz. Here are some simple rules to follow when wrapping your mind around proper data viz.

Show, Don’t Tell

A rule of cinema is to show, don’t tell. The same holds true for infographic design. The foundation of any good infographic is data viz. As an infographic designer, you may or may not determine the concept and compile all of the research for the final design, but either way you are responsible for turning that information into a visually stimulating, cohesive design that tells a story and that doesn’t miss a single opportunity to visualize data. Take this portion of an infographic about Twitter by ViralMS as an example:

twitter infographic
This Twitter infographic writes out the data, rather than visualizing it.

What’s wrong with this infographic? It breaks the first rule right out of the gate. When you have an opportunity to display information visually, take it. Here, the tweets per second could have at least been shown in a bar graph. This would enable someone to quickly look at this section and see what’s going on; by seeing the various heights of the bars, the eye could have quickly gauged the differences in tweets per second per event without having to read anything.

If you’re having trouble adhering to this rule, try keeping all of your text on one layer of your AI file (excluding text inside charts and graphs). Every once in a while, turn off the text layer and see whether the infographic still makes sense. If there isn’t any data viz, or if a bunch of pictures are missing context, then you are doing too much telling and not enough showing.

If the Client Wanted an Excel Chart, They Wouldn’t Need You

It might sound harsh, but it’s true. If infographics were as simple as laying out a bunch of standard charts and graphs on a page, then clients would not need to search out great designers. Many tools are online that can create colorful pie charts, line graphs and bar graphs, so you have to take things to the next level for your design to stand out. Taking the data from above, which of the two graphs below do you think would make a client happier?

unique data viz
Two ways to visualize the data from the Twitter example above.

If you answered Graph B, you’re catching on. Of course, not all data lends itself to creative and unique graphs. Graph A might work very well if the rest of the infographic shared a similar aesthetic. Sometimes you just have to bite the bullet and produce a traditional bar graph or pie chart; nevertheless, always consider ways to dress it up, as in the examples below:

infographic examples
Ways to dress up simple graphs for an infographic.

Typography Should Not Be a Crutch

Typography can make or break a design, but it should not be the solution to a data viz problem. More often than not, designers begin an infographic with a great deal of energy and excitement, but they lose steam fast as they continue down the page. This often leads to quick decisions and poor solutions, like using typography to show off a big number instead of visualizing it in some way. Here’s an example:

Too much dependence on typography
TravelMatch’s infographic highlights too much.

Whenever I see this, I’m reminded of the “Where’s the beef?� ad campaign, and I think, “Where’s the data viz?� Although Sketch Rockwell is one of my all-time favorite fonts, this is a perfect example of relying too much on typography.

Any time a research number is provided to you for an infographic, ask yourself how it can be visualized. Percentages can always be visualized with creative pie charts; numerical values in a set can usually be turned into a unique bar graph; and when numbers don’t fit on a consistent scale, you might be able to visualize them in a diagram. Here is another way the above data could have been visualized:

data visualization
An example of how to visualize the TravelMatch data, rather than relying on typography.

Typography Has Its Place

All that being said, typography does have its uses, which should not be ignored when creating an infographic. Most of the time, you will want to focus your creative typographical energies on titles and headings. The title of the infographic is a perfect opportunity to use a fun and eye-catching font and to give it a treatment that fits the theme or topic. Just make sure the title isn’t so distracting that it takes away from the reason we are looking at the infographic in the first place. The truth of the matter is that some infographic topics are boring, but the right title design can engage people enough to scroll through.

Similarly, headings help to break up an infographic and make the data easier to take in, giving you another chance to let your font-nerd flag fly.


The title of an infographic is your chance to draw attention to the design.

Organization And Storyline

Organizing an infographic in a way that makes sense and that keeps the viewer interested is not always easy, but it’s part of the job for most infographic designers. Usually, you will be given a lot of data and will need to create a visual story out of it. This can be challenging at first, but you can follow some general rules to make things easier.

Wireframe the Infographic

Wireframing an infographic enables you to work out a storyboard and layout for the design. You may have an idea of the story you want to tell, but as you start laying things out, you might hit a wall and have to start over. Having to reorganize after having already done a lot of the design is incredibly frustrating. Avoid this by setting up your storyline at the start to determine what data to show and how. Set aside an hour to sketch things out and make sure it all makes sense. This will also help to ensure that the color palette you will choose drives attention to the important points and keeps the eye flowing down the page.

Think Outside the Box

As you wireframe the infographic, you will identify section breaks that help to tell the story. Most infographics online have a vertical flow, in which each section has a heading to distinguish it from the last. This gets boring fast. Organizing the data and sectioning off information without relying entirely on headings and color breaks is a good way to break the monotony.

For instance, rather than going for a typical one-column layout, you could use two columns in certain parts. You could also break up sections with borders, with backgrounds of different shapes or give the entire design a road or path theme. Here’s some outside the box layouts to get your creative juices flowing:

unique infographic layouts
There are many unique ways to lay out an infographic that will keep the viewer engaged.

Tell a Story

All good stories have a beginning, middle and end. Infographics deserve the same treatment. At the beginning of the infographic, introduce the problem or thesis. From there, back it up with data. Finally, end the infographic with a conclusion.

Visualize the Hook

Every good infographic has a hook or primary take-away that makes the viewer say “A-ha!� As a designer, you should make this hook the focal point of the design if at all possible. Placing the hook at either the center or very end of the infographic is usually best, so that it grabs more attention. Give the most important information the most visual weight, so that viewers know what to take away. Here are some examples of well visualized hooks:

hooks in infographics
Hooks should either be in the center, beginning, or end of the infographic and need the greatest visual emphasis.

Cleaning Things Up With Color

The difference a color palette can make is amazing, especially in the world of infographics. The right palette can help organize an infographic, evangelize the brand, reinforce the topic and more. The wrong palette can turn a great topic into an eyesore, harm the brand’s image and convey the wrong message. Here are some tips to consider when choosing colors for your infographic.

Make It Universal

In Web design, it’s always important to choose a palette that fits the theme of the website and that is neutral enough for a diverse group of visitors. Because infographics are primarily shared online, picking the right palette for an array of visitors is equally important. You must also consider what looks good online.

For instance, dominant dark colors and neons typically do not translate well on infographics; neon on black can be hard to read, and if there is a lot of data, taking it all in will be a challenge. Also, avoid white as a background whenever possible. Infographics are often shared on multiple websites and blogs, most of which have white backgrounds. If your infographic’s background is also white, then deciphering where it begins and ends will be difficult.

A Three-Color Palette Is Easy on the Eyes

With all of the data that goes into an infographic, make sure that the reader’s eye easily flows down the page; the wrong color palette can be a big barrier to this. Choose a palette that doesn’t attack the senses. And consider doing this before you start designing, because it will help you determine how to visualize the various elements.

If picking a color palette is hard for you, stick to the rule of three. Choose three primary colors. Of the three, one should be the background color (usually the lightest of the three), and the other two should break up the sections. If you need to add other colors, use shades of the three main colors. This will keep the palette cohesive and calming, rather than jarring.

Use the Tools at Your Disposal

When picking colors, you don’t have to reinvent the wheel. A number of great websites out there will help you choose the right palette for your infographic. Adobe’s Kuler offers fresh themes and a searchable database, as well as an easy tool to adjust the palette that you’re interested in. One issue with Kuler is that all of the palettes have five colors, and the colors are sometimes from completely different families, rather than shades of a few primary colors, so finding the right palette can be like searching for a needle in a haystack.

Another color-picking tool is COLOURlovers. This database is easier to search through: it breaks palettes into different themes and can be sorted by favorites. While most of the palettes also consist of five colors, the colors are not always given equal weight; instead, the tool suggests which should be dominant. Here are some good and bad palettes for infographics:

infographic color palettes

Final Thoughts

While these standards are important to consider for most infographic designs, sometimes an infographic comes along that breaks all of these rules and still succeeds immensely. In the end, clients like “eye candy� and designs that “pop!� While such terms are subjective (and annoying to most designers), we all know a great infographic design when we see one, and your clients do, too. Use these rules to guide you into the infographic realm, but create your own techniques and standards after you’ve gained some experience.

(al)


© Amy Balliett for Smashing Magazine, 2011.


Illustration Inspiration for the Weekend


  

On multiple occasions in the past, we have compiled the works of several artists to give our readers an extra dose of inspiration for the weekend. This post follows along that theme, only we are refining the inspirational artists to a particular medium, illustrators. So this installation is going to veer off a bit from its predecessors, but we promise the inspiration will still deliver.

Below is a showcase of some artists you may or may not have heard of before, but who’s work we couldn’t help but shine a light on. Their illustrations range in styles and depth, but all share one important trait; their ability to connect with viewers and inspire them. We hope you enjoy this illustration inspiration collection.

Joe Fenton

Joe Fenton has a gallery filled with rich and deeply detailed work, often featuring retro-styled, exaggerated cartoonish characters. This injection of whimsy still maintains something of a dark edge, however, giving the work attitude and tone.

Jacqui Oakley

Jacqui Oakley has a colorful, vintage style of work that embodies an innocent nature. His vibrant illustrations feel like they could have been lifted right out of another era. Such a simple feel, from pieces that are actually anything but.

Irina Vinnik

Irina Vinnik has a wonderful, almost Victorian artistic sensibility that shines through from her gallery. Such gorgeous illustrations brimming with soft colors and layers of detail.

Pale Horse

Pale Horse has a gallery that is full of highly intricate, masterfully detailed pieces that speak volumes to the viewer. This emotive, at times darkly so, portfolio varies in theme, but never in quality or lacking in punch.

Natalie Sklobovskaya

Natalie Sklobovskaya is an illustrator with something of a uniquely simplistic seeming style. When in reality, the work is deeply layered and at many times abstract. All of which feeds its poignancy.

Miss Led

Miss Led has a gallery that is rife with passion and playfulness, lightly circling the edges of sensuality at times. Subtle and mostly character driven, these fantastical pieces are rich without being overpowering.

(rb)


Design With Dissonance





 



 


You might consider yourself knowledgeable, but you’ve probably never heard of this powerful communication and design technique that I’m about to share. I’m sure you’ve seen it in practice but never knew it was working on you — that’s how good it is. I’m here to shed light on this technique so that you can use it as an approach to your design or writing.

See what I did there? I introduced you to dissonance by using the technique itself. If used correctly, it can enhance your approach to design and copywriting in certain projects. Welcome to designing with dissonance!

What Is Dissonance?

To understand dissonance, knowing first what consonance is would help. Consonance is when you feel comfortable with your beliefs; a certain harmony exists in how you’re feeling right now. You feel good. Dissonance occurs when something disrupts your consonance. It challenges your beliefs and makes you feel uncomfortable. You feel bad, or you think to yourself, “What the heck is going on?�

So, why should you know about dissonance and consonance? How are they relevant to design and writing? They are relevant because they are the key ingredients in cognitive dissonance, one of my favorite theories of Leon Festinger.

Festinger’s basic hypotheses for cognitive dissonance are as follows:

  1. The presence of dissonance, of being psychologically uncomfortable, will motivate the person to try to reduce the dissonance and achieve consonance.
  2. In addition to trying to reduce dissonance when it is present, the person will actively avoid situations and information that would likely increase it.

Why Should You Use Dissonance?

We are going to focus on the first hypothesis as a new way to design and write. Put simply, it stipulates that we always want to reach consonance when we experience dissonance. May the persuasive madness begin!

We often try to convince people to use our solutions through our writing and design. In your attempt to persuade them, design with dissonance as a way to challenge their beliefs, and then introduce your service as a way to help them achieve consonance.

Writing With Dissonance

My introduction to this article uses dissonance. I suggested you were knowledgeable but that you haven’t heard of this technique. If you felt uncomfortable about not knowing this technique, then perhaps you chose to read on in order to learn it and feel comfortable again. And because I’m also a detective (well, not really) and possess mad deductive-reasoning skills, I can infer from the fact that you’ve read this far into my article that the dissonance may have worked on you! Aside from my attempt in the introduction, some amazing articles in our industry use dissonance beautifully.

An Essay by Paul Scrivens

A good example is Paul Scrivens’ essay, “You Are Not A Designer And I Am Not A Musician.� I love this essay, and many designers have shared it with their peers. Here’s an excerpt, in which he begins to use dissonance:

No, you are not a designer. You are someone that can piece together some stuff in Photoshop or add the right pieces of code in XHTML/CSS. You aren’t the person that creates experiences. You aren’t the translator of ideas that people never thought could be produced visually. You aren’t the person that can toss their own style to the curb and come up with something even greater because of it.…

We live in a world of hobbyists and the majority of our peers are hobbyists parading as professionals. They are not designers.

But you could be. Maybe. Just take the time to study like the greats before you. Push your limits. Test your boundaries. Designers like to work within their comfort zone because they know what they will like. Make something ugly to help you come up with some ideas on how to make something beautiful. When you need inspiration create your own.

Scrivens has disrupted your consonance here, which created dissonance. He challenged your beliefs. He blatantly told you that you are not a designer. But in the midst of your dissonance, Scrivens offers solutions: he suggests that you study like the great designers before you, and he makes recommendations on how you can find your own inspiration to become a designer. These are solutions you could follow to bring you back to consonance. Cognitive dissonance at its finest. Yes, you could have simply dismissed Scrivens’ attempt at dissonance, but then the theory would have worked even then; you wanted to maintain your beliefs and feel comfortable.

An Article by Whitney Hess

In her article “You’re Not a User Experience Designer If…,� Whitney Hess demonstrates wonderful writing with dissonance. She could have taken the easy way out and written it as the “Top 10 Ways to Be a Better User Experience Designer,� but I doubt it would have had the same impact as the real article had on that glorious day when user experience designers shared it with their peers to defend their work.

Dissonance was possibly created when designers read the title of the article. I’m sure many designers must have thought, “How dare she say what I am and am not. I must read on to refute this nonsense!� But as they read the article, they would have found Hess offering a list of things that do not make them user experience designers. The list might have made them psychologically uncomfortable (dissonant), but they may have decided to act on the list items to make themselves feel more comfortable and to bring back consonance. The article challenged beliefs and fostered great discussions.

A Project Built On Dissonance

You can base an entire project on dissonance. McKinney made an amazing online game about surviving poverty and homelessness, called Spent. Visitors are challenged to live on $1000 a month. Most people think that it’s easy to make a living and act like no one has an excuse. They accept the challenge because it seems easy enough. In the end, they walk in the shoes of someone less fortunate and begin to understand their hardships.

We see dissonance right away on the main page, “But you’d never need help, right?�

Spent Intro

We feel psychologically uncomfortable and try to correct it by accepting the challenge. We are then presented with the following narrative:

Over 14 million Americans are unemployed.

Now imagine you’re one of them.

Your savings are gone.

You’ve lost your house.

You’re a single parent.

And you’re down to your last $1,000.

Then we are asked whether we can make it through the next month or would like to “Find a job.� If we choose the latter, we are presented with current job openings: restaurant server, warehouse worker or temp.

When we make our choice (in this case, warehouse worker), a description of the job is shown and we continue:

Spent Health Insurance

We continue to face more choices that make us uncomfortable, such as whether to opt in for health insurance. If we opt in, we see the impact on our finances, which helps us understand something meaningful about low-income workers.

Spent Result

We then need to choose where to live relative to our place of work. Living closer means higher rent, while living further away means higher transportation costs. You are then asked to pay your rent and transportation costs.

Spent Find Home

And then we are presented with even more uncomfortable situations that create yet greater dissonance!

Spent Small Apartment

When we finally reach our tipping point and want to correct the dissonance, we can get out at any time. A small link in the corner reads, “I can’t do this.� And then we are asked to take action and help by getting involved:

Spent Final

As you can see, the website creates an intense experience of dissonance. And it offers a way to help us reach consonance by donating, sharing and getting involved with Spent.

More Dissonance In The Wild

As mentioned, dissonance is already being used, and you might not have even noticed its power. Let’s look at some attempts at cognitive dissonance, where businesses challenge our beliefs and then suggest their services as a solution.

Adobe

If you’re a PHP developer, Adobe will definitely disrupt your consonance by asking, “Who needs PHP?� The ad leads to Business Catalyst, where Adobe explains how you can build database-driven applications without writing code!

A Book Apart

HTML5 - A Book Apart

The HTML5 spec is 900 pages and hard to read. HTML5 for Web Designers is 85 pages and fun to read. Easy choice.

HTML5 is the longest HTML specification ever written. It is also the most powerful, and in some ways, the most confusing. What do accessible, content-focused standards-based web designers and front-end developers need to know? And how can we harness the power of HTML5 in today’s browsers?

In this brilliant and entertaining user’s guide, Jeremy Keith cuts to the chase, with crisp, clear, practical examples, and his patented twinkle and charm.

The introduction to HTML5 for Web Designers creates dissonance by suggesting that we don’t have the time or energy to get through the HTML5 spec. It recommends that we use this book to learn the important parts of the spec, which will bring us back to consonance.

37signals

Projects Manage Themselves with Basecamp. Millions of people use Basecamp, the leading online project collaboration tool.

The subheading for 37signals’ Basecamp is powerful. Knowing that millions of people are using Basecamp to get stuff done and that you’re not one of them might challenge your thinking. Are you missing out? Are those people more efficient than your team? You might consider using this product to gain efficiency.

Blinksale

Send Invoices. Accept Cards. Tired of PayPal? Signup for Blinksale with Blinkpay. Just $24/month for both.

For those of us who use PayPal, Blinksale attempts to create dissonance through its ad on The Deck by asking whether we are tired of our current service. Some of us feel that PayPal is a good enough service, but Blinksale claims to be the easiest way to send invoices online. With our beliefs challenged this way, we might decide to look further into what Blinksale has to offer in order to resolve our dissonance.

Where To Start?

If you’d like to apply cognitive dissonance, I suggest starting simple so that you can A/B test and gather feedback more easily. Then, you could incorporate more of it as you become comfortable with applying the theory. For now, start by using dissonance in a few of the headlines on your website to convince people to do business with you. Take the boilerplate headline that we see on most freelancers’ websites:

Hello. My name is Tad Fry, a Web developer and designer who makes websites.

Apply some dissonance:

Your competitor’s website is better than yours. Let’s work together to change that.

This might be blunt, but we want to challenge beliefs. If someone feels that their website is better than their competitors’ but then is challenged by your headline, they might be inclined to call you to resolve their dissonance. If you want to appear less provocative, you could phrase it as a question.

Is your competitor’s website better than yours? Let’s work together to change that.

Even though we are phrasing it as a question and the potential customer might agree (consonance), we are still creating dissonance because they might not have even considered that their competitor’s website might be better. We’ve now made it less direct and perhaps less insulting. Getting the right balance between dissonance and a respectful tone is sometimes difficult, but as with most of our work, gathering feedback and making changes based on it is important. This brings up another part of the theory.

In his book A Theory of Cognitive Dissonance (see pages 3 to 18), Leon Festinger writes (18):

The strength of the pressures to reduce the dissonance is a function of the magnitude of the dissonance.

We might prefer to be more direct, because that will create greater dissonance, which would put more pressure on the audience to reduce it. Again, it comes down to how much dissonance you want to create without insulting the visitor or completely missing the target. After all, the visitor could achieve consonance simply by choosing not to listen to you at all — which is why testing your work is so important.

Now Go Forth And Challenge Beliefs!

Hopefully I’ve whetted your appetite for this approach. I encourage you to look more into the theory, which is more involved than this introduction. And that’s the beauty of it. The various degrees of dissonance offer new approaches to your next design. Try adding dissonance to just a headline or page element at first. Be careful not to insult; you simply want to challenge beliefs and offer your product as a solution.

(al)


© Tad Fry for Smashing Magazine, 2011.


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