Northern Voice 2011

And it’s that time of year again. Time to hob-nob with all sorts of bloggers and assorted geeks in UBC’s lovely Life Sciences Centre, with its gorgeous atriums filled with natural light.

And it’s that time of year again. Time to hob-nob with all sorts of bloggers and assorted geeks in UBC’s lovely Life Sciences Centre, with its gorgeous atriums filled with natural light.

Friday Keynote: April Smith

This was different. Both previous keynotes dealt with high-level politics, how social media intersects with mainstream media and corporate power. But April Smith brought us down to earth for a moment with her stories of living in the Downtown Eastside. We learned about her work as a citizen journalist empowering the residents with access to technology—Nokia handphones, specifically. I forget the exact model, and I’ll forgive the constant product placement, especially if it turns out that they’re as easy to use as she claims. Those phones were donated by some Nokia rep, and it’s a hard reminder that this shit ain’t free, and every social movement must depend on the kindness of sicher strangers.

April was clearly nervous and reading from prepared notes—she admitted to being uncomfortable speaking in front of people—but that didn’t matter. Her stories were raw, straight from the heart, and powerfully moving. The short clip of the man whose cat was thrown out of his 5th storey apartment during a breakin. The simple brief connection that stopped a man from killing himself, just because she showed him a bit of kindness and let him see his own photo. If April hadn’t been there, with her phone, that man would now be dead.

That’s what social media means, in the Downtown Eastside. It’s about connecting with people, telling your story, and changing lives for the better.

Drawing on Walls

Okay, that was kind of a bust. I don’t think I got anything out of it, except yet a reminder that my drawing skills suck. I chose this session just to go a little outside the box (and because none of the other ones really appealed to me), but an hour-long workshop wasn’t going to give me any super-creative power. Ah, well. Live and learn.

Your Blog Is Boring and Your Photos Suck

Syx Langemann and Morten Rand-Hendriksen teamed up to give the audience some tools to make their photos suck less and their blogs less boring. Somewhat disappointingly, they mostly covered the technical aspects (Syx: aperture, shutter speed, ISO; Morten: ALT tags, meta tags, SEO, and WordPress-specific tidbits) but not so much ways to make things less boring or sucky. I guess that part is up to each of us. But I did love the sample photos Syx showed us; nothing like the portfolio of a talented photographer to get you inspired!

The Naked Truth: Canadian Science Blogging Scene

A panel consisting of Rosie Redfield, Beth Snow, Eric Michael Johnson and Maryse de la Giroday discussed science, blogging, and all related issues. Does blogging impact your credibility as an academic and researcher? What are the pros and cons of pay-to-read vs. pay-to-publish journals? What place do non-peer-reviewed blogs have in science education and research? What incentive do researchers have to blog about their work if it means the risk of competitors scooping them out (and their funding)? Why would a researcher blog?

Dr. Redfield (who did most of the talking) answered that last question: she likes the idea of a non-scientist stumbling on her writing, it clarified her thinking, serves as a memory aid, and helps her write. Also, it allows her to critique science in the media.

Good stuff, for sure.

Incidentally, I found it interesting that 3 out of the 4 panelists were women. I wouldn’t have expected that kind of breakdown for science bloggers and academics, but there you go.

Also: the following day at lunchtime, Dr. Redfield took a few of us on a short tour of the labs in the building. Behold the power of social media: there was no big announcement, no signs put up, just a couple of calls retweeted back and forth.

MooseCamp: Five Card Flickr

Five Card Flickr is fun. Our small group spent the hour with Alan Levine getting to know the game, choosing pictures, and coming up with a story. Didn’t go anywhere and it had no plot, but man was it fun. I haven’t taken part in this kind of collective storytelling since… what, my D&D days? Ooo, and check out Pecha Flickr.

Communities That Rock

How do you create kick-ass online communities? Arieanna Schweber and Raul Pacheco-Varga give us the lowdown. Some of their advice applied for blogs, others for forums and community sites, but the bottom line is pretty much the same: engage with your audience, have everything (tweets, photos, videos) point back to a single site, have proper internal linking, know how to tell a story. Pretty common-sense stuff, right? Maybe, but it has to be said. Also, keep in mind that this is hard work, and community building doesn’t happen overnight. Finally, avoid becoming isolated. It’s good to be active both offline and online.

Saturday Keynote: Chris Wilson

Chris Wilson took us on a trip down memory lane, reminiscing about NCSA Mosaic (which I also remember fondly from my early days on the WWW), his early work on Web standards—apparently he’s responsible for overlapping <B> and <I> tags—and adventures in social media. Of course, they didn’t call it that. But games like Nethack (through other people’s ghosts) and other applications allowed connections and interaction between people, mediated by technology. And isn’t that what this conference is about?

Wilson cautioned us: There are people that need to learn how to play well with others. What voice should you use? How much should you share? Sharing feels good. It makes you vulnerable, but you create lots of real connections. I guess it’s up to each of us to choose how far to take it. He closed off with a quote from the late, great Douglas Adams

I may not have gone where I intended to go, but I think I have ended up where I needed to be

A Code of Ethics For The Social Web

Morten R-H again, this time discussing our responsibility, as bloggers, to the truth. This applies much more to journalism-style blogging, and reviewers, but everyone can benefit. Really, it boils down to a few simple principles: be honest with yourself and your audience; admit when you may be biased (e.g.: when you get freebies in exchange for reviews), be critical of your own biases and opinions. It is important to have such a code of ethics, and hold each other accountable, because anyone with a big enough audience has a big influence.

Trust relationships—brought up by an audience member who disagreed with Morten’s basic thesis—will only take you so far. It’s all very well to personally be critical of the blogs you follow and if you find they’re unreliable, well, to just stop following them, but (a) that does nothing to discourage unreliable bloggers, and (b) it doesn’t help people who don’t have working bullshit filters. If the Tea Party, 9/11 Truthers and the Huffington Post* have taught us anything, it’s that popularity has very little to do with truth.

(*Seriously, early on in the talk he lumped all three together. Awesome)

And here’s his code of blogging ethics

Looking Through The Lens

Alan Levine again, taking us through some of the ins-and-outs of taking good photos, both from a technical and creative standpoint. It was great stuff, but hard to summarise.

Stop Apologising For Your Online Life

Alexandra Samuel asks: is online life any less real than IRL? Are those three letters themselves a dead giveaway? She argues that no, life online is just as interesting and meaningful as offline. She proposed a new 3-letter term: RLT, meaning Real Life Too. Kinda catchy, though I’m not really feeling it. Still, who knows? It just might catch on.

Online art is just as valid and meaningful as offline art, just because you can’t hang it on a wall or show it off in a gallery. There is amazing stuff being done online, like the It Gets Better Project (and indeed, for a lot of queer youth, online is the only way to connect with other queer people); I’ll just add Pogo’s fantastic remixes.

But you also have a responsibility to your online life, as much as your offline one. Don’t be passive, invest real attention; give back, and commit to creating something real. Likewise, don’t just friend any Tom, Dick and Harry on Facebook. Friendship means something, online as well as off-. Only connect with people you feel a relationship with, not just faces that’ll increase your friend count.

Conclusion

I left early on Saturday, because I was still feeling a bit under the weather, but I’m so glad I went. Looking forward to next year’s Moose!

WordCamp: Developers

Yesterday was a very, very good day. Why? Because I went to WordCamp: Developers, that’s why! A whole day of knowledge, hot geeks, and interesting people. Though I’ve been tinkering with WordPress for a few years now, I’ve been starting on larger projects for other people (both volunteer and paid). It’s exciting and a little scary.

Yesterday was a very, very good day. Why? Because I went to WordCamp: Developers, that’s why! A whole day of knowledge, hot geeks, and interesting people. Though I’ve been tinkering with WordPress for a few years now, I’ve been starting on larger projects for other people (both volunteer and paid). It’s exciting and a little scary.

Keynote

The keynote consisted of Lorelle Van Fossen interviewing Andrew Nacin. Okay, kinda different, but I totally didn’t mind. First impressions: even with that playoffs beard, Nacin is hot. And used to be a fireman. Seriously. Second impression: he loves what he does, and inspired the same kind of love in the audience. “Innovation is the key to WP’s success,” he said. Things like menus, internal linking, even the current design, started out as pieces of code in various themes and plugins. Who knows where our little ideas will lead us?

Also, “Never trust the user.” But that’s a bit less inspirational.

HTML5 & CSS3 Integration For WordPress

Ray Villalobos took us on a whirlwind tour of these new technologies’ features. I was already familiar with some of them (border radius, semantic tags, transparencies) but at the end of the hour, my brain felt more than full. And I still had five more talks to go!

One quibble, though: As informative as it was, Ray’s talk didn’t really have anything to do with WordPress per se. I understand that a good WP developer has to know these things, but they apply to any Web development work. So… should they have been in a WordCamp event? I’m still undecided.

Developing a Control Panel for Multiple Sites Using the Same WordPress Theme

O HAI. Toby McKes works at Cheezburger Networks, the people responsible for bringing you lolcats (and Fails, and Squee, and Graphs) each and every day. I know, I couldn’t believe our humble city could be so honoured.

But bringing laffs to the world takes a lot of hard work. In the early days, all their blogs were running on different hacked themes, they all looked at least a bit different, and maintaining them was a huge headache. The solution was a unified theme, with dozens and dozens of theme options, controlled via a custom admin panel. This made installations a breeze, since they were all running on the exact same code. They even have a tool for importing and exporting options, too!

This really resonated with me, because one current project involves implementing a site with lots of custom options. I don’t need a full-blown admin panel for multiple installations… but it’s good to know others are dealing with similar issues.

Unconference: Finding Work as WordPress Consultants

I decided to skip the WordPress e-commerce talk (though I heard later it was very informative) and headed over to the Unconference track for a little discussion with Lloyd Budd on making money with WordPress. I’m honestly not sure if I have enough experience to really make a go at it just yet, but I want to know what options (and obstacles) lie ahead. We discussed CodePoet and other consultant-finding sites, and shared personal insights. No insights from me right now, but maybe next year…

Tackling JavaScript for WordPress

Again, lots of information, great if you want to get into fancy web development, but not directly related to WordPress. (Almost as an afterthought, he did mention wp_enqueue_script()). But I have to say, I loved how enthusiastic, yet low-key Allen Pike is about JavaScript. The way he says “Mind-blowingly awesome code you’ll learn a lot from” in an adorkably deadpan voice is just awesome.

Challenging Traditional WordPress Design

So you’ve got your traditional blog design with all this extra navigation in the sidebar: categories, tag clouds, recent posts, etc… Is it useful? Do people read them, or do they just tune them out? Catherine Winters looks at various site designs and relevant studies and concludes that, no, they’re not that useful. That a lot of these frills are in fact making pages harder to read, and that today’s web designers are ignoring lessons learned over centuries of print design.

Catherine’s delivery could have used some polish, but her ideas were right on the money. In my last blog redesign I deliberately cut out all the sidebar bits she mentioned. My inspiration, in part, came from AdamSchwabe.com, whose blog was even more radical in its minimalist design. And worked beautifully.

Possibly the Strangest WordPress Project You’ve Ever Seen in Your Life

That’s really what the schedule said. And holy shit did it deliver. Mark Reale led us through the design and implementation process of 6q.com, a site he did for artist John Oswald. It’s a trippy thing, loaded with crazy JavaScript animation, but it really does run on WordPress!

Oh, and I won a book at the end of this talk, too. Jesse James Garrett’s The Elements of User Experience. Go me!

Final Thoughts

So, that was WordCampDev. The organisers did a fantastic job, and I love these events because there’s so much to learn and absorb, and I come home so inspired! Looking forward to Northern Voice next week!

WordPress Options

I’ve been working on a project that involves reimplementing a site in WP. This specific setup requires quite a bit of custom logic, including several dozen options. It’s interesting work, and I feel I’m really stretching myself as a WordPress developer.

I’ve been working on a project that involves reimplementing a site in WP. This specific setup requires quite a bit of custom logic, including several dozen options. It’s interesting work, and I feel I’m really stretching myself as a WordPress developer.

Options in WordPress are easy to do. My first exposure to them was from looking at various themes’ options, but when you get right down to it they’re very simple. It all comes down to three little self-explanatory functions, that may be used anywhere in a theme:

set_option('option name','option value');
get_option('option name');
delete_option('option name');

That’s it, that’s all you really need. Now, a good theme or plugin will put in a lot of extra logic to make options pages nice and user-friendly. For instance, Erudite will structure options in a multi-level array, like so

$erdt_options = array (

	array(	"name" => __('Dark Colour Scheme','erudite'),
			"desc" => __("For all the dark colour lovers out there",'erudite'),
			"id" => $shortname."color_dark",
			"std" => "false",
			"type" => "checkbox"),

…and so on. Each field has a name, a description, a type (for the options screen), an id (used to retrieve and store the option) and a default value (“std”), for when a user wants to reset a theme. All of these are completely optional and depend on how the developer wants to built the options page. Unlike Drupal, there doesn’t seem to be a standard API.

The code might look something like this (again, taken from the Erudite theme):

foreach ($erdt_options as $value) { 
  switch ( $value['type'] ) {
    case 'text':
    // display one text field
    case 'select':
    //display a dropdown
  }
}

And to display one field:

<input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" />
        <?php echo __($value['desc'],'erudite'); ?>

As you can see, each input field has its own ID, in case you want to do a bit of styling. Personally I would also add a general class to cover all fields, or maybe different classes for different types.

Saving these options is also quite simple:

foreach ( $erdt_options as $value ) {
  if ( isset( $_REQUEST[ $value['id'] ] ) ) { 
    update_option( $value['id'], $_REQUEST[ $value['id'] ]  );
  } 
  else {
    delete_option( $value['id'] );
  }
}

I’m ignoring all questions of where all this code fits in the functions.php file, where to place options pages in the admin section. That’s a topic for another day; I’m just going through the basics for my own benefit, and that of anyone who reads this.

WordPress Queries

A little while ago I had to display author pages for posts of a certain custom type. Let’s call it “portfolio.” Now, I’m still learning, but my understanding is that author page templates require the following logic:

A little while ago I had to display author pages for posts of a certain custom type. Let’s call it “portfolio.” Now, I’m still learning, but my understanding is that author page templates require the following logic:

  1. Go through at least one iteration of The Loop (by calling the_post())
  2. Use the_author_meta() or get_the_author_meta() to get the author info you want and display it accordingly
  3. If you also want to display the author’s posts on this page, call rewind_posts() to (you guessed it) rewind The Loop, or build a whole new query

You don’t need to explicitly build a query at the start of the template. That’s automagically taken care of you by WordPress. However, if you want to get more specific, here’s how it’s done:

global $wp_query;
$args = array_merge( $wp_query->query, array( 'post_type' => 'portfolio' ) );
query_posts( $args );

The first line makes the query object (which is a really complex beast I’m just starting to wrap my head around) visible to the script. The second adds an extra argument to the query string. The third performs a new query. Pretty simple, right?

Mind you, for author pages the above code is only necessary if you’re doing step (3). Otherwise you’re good.

More Magento Annoyances

This week I had to deal with yet more stupid Magento behaviour. First, I had to overload a core controller class. Naively, I tried doing it the easy way at first—ie: simply duplicating the file and file path in the /app/code/local directory and making my changes there. (Which, BTW, always struck me as a deeply stupid way to go about things, but that’s another story)—but that didn’t work.

This week I had to deal with yet more stupid Magento behaviour. First, I had to overload a core controller class. Naively, I tried doing it the easy way at first—ie: simply duplicating the file and file path in the /app/code/local directory and making my changes there. (Which, BTW, always struck me as a deeply stupid way to go about things, but that’s another story)—but that didn’t work. A further bit of research told me that hey, controllers can’t be overridden that way. What you have to do, apparently, is create your own extension, with a controller class extending the core class, and perform other configuration magic.

Read the whole tutorial in the official Wiki here. Speaking of, I’m a little appalled at how incomplete and in need of a cleanup this article is, for what you’d think is a pretty important operation. Not only that, but the editors can’t even seem to agree on the details. For example, regarding Step 2, should the rewritten URL in the config file contain a leading slash or not? For the record, I did need those slashes, but maybe that depends on the version. That, plus lines like

(comments I’m not a 100% sure about are ending with “(?)”):

and

You need to get extra precise with the rewrite regular expression cause this causes a very hard time. In this part.

make the article look really unprofessional. Guys, it’s your freaking official freaking Wiki, you need to (a) be 110% sure about what you’re putting up, and (b) write in correct English. Sheesh.

Anyway. So I followed the instructions and it worked. Yay? But wait! In a crazy twist, my override controller (ie: in the extension) was actually extending my local controller (ie: the duplicate of the core class, that I’d forgotten to delete). So… a local override could have worked after all? Or is it a bug? I have no idea. I decided to just delete the local override and call it a day.

(There was another issue that at first I blamed on a Magento default template, but on mature reflection may have been caused by our team.)

Fieldsets and Drupal settings forms

Blame my lack of experience with Drupal. This week I was held up on a weird problem, and for once the online documentation didn’t seem to be helping.

I was coding a module, with a number of parameters. To keep things tidy, I decided to group them in fieldsets. And, not being too clear on the consequences, I set those fieldsets’ #tree parameter to TRUE. Here’s what it looked like:

Blame my lack of experience with Drupal. This week I was held up on a weird problem, and for once the online documentation didn’t seem to be helping.

I was coding a module, with a number of parameters. To keep things tidy, I decided to group them in fieldsets. And, not being too clear on the consequences, I set those fieldsets’ #tree parameter to TRUE. Here’s what it looked like (simplified example):

function foomodule_admin_settings() {
  $form['foo'] = array('#type' => 'fieldset', '#title' => t('Foo'), '#tree' => TRUE);

  $form['foo']['testmodule_bar'] = array('#type' => 'checkbox',
    '#title' => t('Bar'),
    '#description' => 'Bar',
  );

  $form['foo']['testmodule_baz'] = array('#type' => 'textfield',
    '#title' => t('Baz'),
    '#size' => 20,
    '#description' => t('Baz'));
    

  return system_settings_form($form);
}

What I found then was that the settings wouldn’t save. There were no errors, I got the normal message that “The configuration options have been saved.” but the values in the form were not updated.

After a bit of experimentation and reading up on how Drupal saves these settings, I figured out that the message was correct: my options really were saved, but not in the way I expected.

First, Drupal saves persistent variables in a table, named variable. Each record in this table has two fields: name and value. This field doesn’t exactly hold the value: for some reason Drupal also stores its type and (if it’s a string or array) its length. So (ignoring fieldsets for the moment) the value field for variable “bar” might be

b:1;

(“b” for “boolean”)

—while the value for “baz” could be

s:8:"whatever";

(“s” for “string”)

Apparently, if you’re editing these fields manually, you have to be really careful to make the stored length match the value’s actual length, or Bad Things will happen.

So here’s what it looks like is happening: if a form element is set to '#tree' => TRUE, its child elements’ values will not be stored in the database. Instead, it will get its own line in the variable table, with the value being an array of its child elements’ values. Which here, would look something like this:

a:2:{s:3:"bar";b:1;s:3:"baz";s:8:"whatever";}

This behaviour makes sense, but it seems to break everything about persistent variables. Fortunately there’s a simple solution. Just don’t set ‘#tree’ to TRUE, and the form elements’ values will store correctly. There we go, easy-peasy.

The Joy of Drupal, The Agony of Magento

I’ve been working for a small web development shop for the past few months. It’s interesting work, all open-source, all PHP-based. My first project was with Magento, and it was frakking painful.

I’ve been working for a small web development shop for the past few months. It’s interesting work, all open-source, all PHP-based. My first project was with Magento, and it was frakking painful.

I’m not just talking about the inevitable learning curve of tackling a new code base, and a (to me) whole new kind of CMS. The pain comes from an incredibly unintuitive code architecture that I keep having to wrap my brain around over and over.

From working with WordPress I was used to files for a given theme or plugin sitting together in one directory; this makes sense because they are all part of one module. Not so in Magento. Code, templates and other config elements are spread all across the system. From a design point of view I can sort of see why you’d want your business logic separate from your page templates, and both separate from your javascript, CSS, images and whatnot. You’d think it seems tidier, right? But in practice it makes extensions much harder to code than they should. To enhance or override core functionality, I have to know the exact names of these core classes and where they sit in the code directories, with no tidy hooks or API around which to build my functions.

And that’s not even counting the unholy tag soups in configuration XML files, with weird rules and redundancies that I haven’t been able to grok so far, so I just copy from existing samples and hope it eventually works. For example, according to A book to cook with Magento, config parameters defaults are set in the file config.xml, but if you want to view and modify them in the Web interface, that form is defined in another file, system.xml. My jaw literally dropped when I read up on this. How does it make any sense?

Mind-boggling or not, I’m grateful to blogs like A book to cook because there a serious dearth of online Magento documentation, official or otherwise. As often as not, googling particular issues led me to forum threads asking the same question I was researching… and nothing else, except maybe others chiming in to say they’ve got the same problem, or the same guy posting again a few months later to ask “What, nobody can help me?” Magento just doesn’t seem to have the same kind of active online community as, say, WordPress.

So what you end up with is a system that is way harder than it should be to enhance in any substantial way. Magento is open-source, sure, but if the source is a scary and confusing jungle of code, that doesn’t really help. No wonder people are willing to shell out megabucks for what you’d think are pretty minor extensions, instead of working it out themselves. Case in point:

The Backorder Button extension gives you the ability to display to your customers which of your products are currently on backorder.

If one of your products are on backorder, the Backorder Button extension will change the text’s of your “Add to Cart” buttons to “Backorder” (both in the product list, and on the product details pages), and the “Availability: In Stock” text’s (displayed on the product details pages) to “Availability: Available on Backorder.”. You can of course rewrite / customize the replacement text’s from the System Configuration.

$29 for this? Really? It took my coworker a couple of hours to figure out how to do it. But Magento’s deceptive: what looks simple and obvious isn’t always so. For instance, I had to abandon one extension that I thought at first would take me a few days, but later looked like many weeks of tedious hacking. It’s still on my to-do list, though: it’s useful functionality that should be present in an e-commerce system, but as far as I can tell nobody’s done in Magento yet. I tell you, if I ever make it work I’m going to be a fucking millionaire.

And then there’s Drupal

Now, I only have a few weeks’ actual experience with Drupal. I’d started playing with it a few months ago in preparation for a large volunteer web design project—that will end up using another CMS, but that’s another story. Then last month at work I finally got to do some actual Drupal development.

And it’s true, there’s a steep learning curve, which I’m only starting on. But unlike Magento, the learning process really isn’t frustrating. There are plenty of resources to help me with issues, and at the end of the day I just feel productive: Drupal development is way more straightforward—no mucking around with core classes, no having to create a dozen files in five different directories just for a simple “Hello World” module. Drupal is complex, but not overly complicated. It feels elegant. It makes sense, and I like that. Drupal is, frankly, a joy to work with.

NetSquared Camp 2010

Okay, now that the film festival’s done, I’m finally free to blog about NetSquared Camp 2010, an unconference of activists, technologists, entrepreneurs, and assorted geeks who want to make the world a better place, in a full-day extravaganza of sharing and networking. It was my first NetSquared Camp ever, and I’m still digesting everything I’ve learned. Here’s a rundown of the talks I attended:

Okay, now that the film festival’s done, I’m finally able to blog about NetSquared Camp 2010, an unconference of activists, technologists, entrepreneurs, and assorted geeks who want to make the world a better place, in a full-day extravaganza of sharing and networking. It was my first NetSquared Camp ever, and I’m still digesting everything I’ve learned. Here’s a rundown of the talks I attended:

Social Media Ninja School

Cecilia Lu, owner of Kiwano Marketing, started off my day with some tips on using social media to promote one’s brand.

The first thing to do, she says, is to sit down and set some goals. Is this going to be your business or personal brand? What are the measurable results? Fundraising, volunteering, or just exposure of your brand/message? With so many entrepreneurs in Vancouver, it’s important to make your message uniquely you, to catch people’s attention.

Now that we have a focus, we got some practical tips. The question of corporate twitter accounts was raised. What if more than one person is tweeting? Should you use different accounts, or the same account but marked with your initials or something?

Now, how do you talk to people? Don’t be afraid of trying conversations. Engage someone online by following them, then replying or commenting (but intelligently) if you have something to say. Don’t be shy, and you can find clients, friends, even mentors.

And what’s the ROI? Sales (or whatever your goal is) are not going to skyrocket overnight. It usually takes time to build trust, and it will take you time to build a voice, as well. The best thing you can do in the beginning is to listen.

Measuring Social Media Success

Darren Barefoot has co-written a book on social media marketing, based on his years of experience, and that morning he walked us through some of its insights, condensing it into ten basic rules, including:

  • Set quantifiable objectives (as opposed to things like public opinion, or “brand”)
  • Beware of creatively named metrics, like “engagement.”
  • Measure everything.
  • Iterate rapidly, and
  • Fail fast. (These two ideas come from the world of software. Social media is very young, and we’re still figuring it out.)

And, the acronym POST, representing the necessary steps of any social media campaign, in their proper order:

  1. People
  2. Objective
  3. Strategy
  4. Technology

You have to start with people, but so many just start with technologies.

Many of the examples he gave us were taken from his recent work on The Big Wild, a conservation site big on infographics, clear and simple navigation, and easy actions to take. Perfectly consistent with his earlier talk at Northern Voice on doing good on the Web.

(And here are the slides of his talk)

All About SEO

This very informal talk was facilitated by Sean Cranbury, who works as a media consultant.

We talked a bit about keyword research and testing. Google Keyword Tool is your friend here. You need to look for keywords with high cost per click but low competition. That’ll help you stand out from the crowd.

Apparently meta tags don’t make a difference with Google rankings, though they used to once upon a time. For small businesses, you shouldn’t worry too much about keywords; authenticity and passion count for a lot. Quality content is important, of course, but there’s also metadata, dates and locations. All of that counts too. I think it’s here that someone brought up Google Maps as an advertising tool. Create a custom map, add whatever landmarks you wish (like, say, your business), make it public, and voilà, now you’re searchable in Google Maps or Google Earth. It seems this is an amazingly useful but so far underutilised advertising tool.

Then you’ve got the old standbys: blogging, twittering (and don’t forget hash tags!) WordPress provides many SEO opportunities. Sean mentioned a couple of themes that are heavy on SEO: Canvas, and Thesis.

Converting a static site to WordPress (or any other CMS): change as little as possible, including the URLs. If needed, use 301 redirects.

And, of course, to bring in incoming links, you have to have people engage with the site.

Finally, Google Adwords are a good way to test if your SEO campaign will really end up with the results you want. A campaign may last for months, and you want to know right away if it’s going to be worth it.

Advertising Campaigns

Another presentation by Darren Barefoot, on the finer points of Google ad campaigns.

Adwords show up in Google searches, which means we have to focus on keywords first and foremost.

Our ads compete for the top spot; Money × Quality determine your ranking. You pay per click, so it’s okay if an ad isn’t working.

To start, be as specific as you want. To write the ads, use good copywriting, make it compelling. Create landing pages for each of those ads so the action is immediately available, don’t send them to your home page. Then, you want to track conversions or other actions, which is what his earlier talk was all about.

Facebook ads are very different from Google ads, because you can target them by age, gender, or any other preferences.

As a final note, Google ads are not good for revenue generation unless you’re covering your site with ads, and/or have lots of traffic.

Conclusion

NetSquared was an amazing and inspiring experience, with excellent people who I learned a lot from, and who I may be able to help in return. There’s so much being done right here in this city, and I’m going to be a part of it. More than before, I mean.

Also, I have to give a shoutout to Nuba, where a whole bunch of us went to eat. The food was excellent (I’d never tried Lebanese cuisine before), and they handled our large group perfectly well.

Learning jQuery: toggleClass( )

I’m still a novice at jQuery, and recently had a chance to learn a little bit more, for a project I’m working on.

I’m still a novice at jQuery, and recently had a chance to learn a little bit more, for a project I’m working on.

Here’s the HTML (classes and ids simplified a bit):


And here’s the desired behavior: when the link is clicked, the parent div (ie: #base) should switch its class between “black” and “white”. What actually happens to the styles, we won’t get into here. My first attempt went like this:

$(document).ready(function(){
    $(".black a#toggle").click(function() {
      $("#base").removeClass("black");
      $("#base").addClass("white");
    });
    $(".white a#toggle").click(function() {
      $("div#base").removeClass("white");
      $("div#base").addClass("black");
    });
  });

But that wasn’t working. One click did toggle #base from “black” to white”, but a second click wouldn’t toggle it back to “black”. It looked like since the page was loaded with “black” as the div’s actual class, the click function was only bound to “.black a#toggle”. After a bit of experimentation and research, I found the answer: toggleClass(). So my code read like this:

$(document).ready(function(){
  $("a#toggle").click(function() {
     $("div#base").toggleClass("black");
     $("div#base").toggleClass("white");
  });
});

And that worked. Ah, but there’s a better way! toggleClass() (just like addClass() and removeClass(), as it turns out) can take a space-separated list of classes as its argument; each one of these classes will be toggled in the selected element(s). So, to switch between “light” and “dark” I just need a single line:

$(document).ready(function(){
  $("a#toggle").click(function() {
     $("div#base").toggleClass("black white");
  });
});

Easy-peasy! toggleClass() can do more than what I’ve show here, though! Read the official documentation for the full story.

The New Look

Well, that took a lot longer than I expected. But then these things usually do, right?

Well, that took a lot longer than I expected. But then these things usually do, right?

The design really only came together in the last couple of months. I remember at Northern Voice I was still struggling with placing a daily photo on the front page, with all the headaches that would entail. I still think it’s a cool idea, but I just couldn’t make it work. On the other hand, I’ve still got Sunset Beach and the West End in my header image. Right now it’s a static photo, but with a bit of thought I’m sure I could make it dynamic…

The other thing that pulled everything together was playing with Twenty Ten. As soon as 3.0 came out I dove right in and started building a new child theme. In hindsight Twenty Ten might not have been the best place to start, since a lot of my layout ideas came from a beautiful theme called Erudite.Though the documentation for Erudite mentions specifically that it’s for writers, I’ve found that it does pretty well for any content. (Hell, my inspiration, the lovely Life For Beginners, is very photo-heavy, and it works quite well.) I was attracted to Erudite’s clean and open layout, with minimal content in the sidebar, and had decided then that blogrolls, category archives, or what have you, could either go in the footer or just disappear.

Mind you, Twenty Ten is a great learning tool, so it certainly wasn’t wasted time. At WordCamp one of the speakers said you should try to develop your themes from scratch, because when adapting existing themes you may wind up with unknown design issues or unnecessary features. True enough (for example, I’m not using half of its widget areas): but I’d never gotten so deep into a theme before, and at least now I have first-hand experience of all these features I may or may not need.

What else? A lot of little things: threaded comments, gravatars, an honest-to-gosh contact form, courtesy of the excellent Contact Form 7 plugin. A redone blog archive page, inspired by that of Equivocality, and using the same plugin, Smart Archives.

Also, I decided to drop categories and go with tags. For a while I thought about using both, but every category scheme I came up with was either (a) so broad it became useless, or (b) so fine-grained it might as well be a tag cloud.

And finally, a portfolio! I’ve been talking about my volunteer web design projects for a while now, so why not show them off?