ShooFlyBuzz

Welcome to ShooFlyBuzz, the company weblog. We use this space to talk about what’s happening with ShooFlyDesign, but more generally to talk about web design, the challenges we encounter, the tools we use, websites we like, and provide some training on the care and feeding of your own website.

If you want to send in feedback, leave a comment, send an email, or tweet @shooflydesign.

lynda.com - online training videos I'm delighted to announce that my new course, JavaScript for Web Designers, is now available in the lynda.com online training library.

If you're a web designer comfortable with HTML and CSS, and want to learn how to add interactivity to your projects, this course will help you do that. You're not going to master the entire language and everything it can do in three hours, but it will get you rolling in a hurry, developing your intuition and understanding of using JavaScript on the web. Using this course as a foundation, you can move further into the world of writing code for web browsers, and making all kinds of cool stuff on the web.

There are many free videos available, so you can listen to the melodious sound of my voice and get a feel for the examples and teaching style. Check it out!

Categories: 

I'm working on a Drupal project that requires calculating some custom stats for each registered user. To get it working, I ran my SQL queries right in hook_user_load(), which is wildly inefficient; it's much better to run the queries once and cache the results for a while. Drupal has nice cache functions built-in, and I thought I should use them, but wasn't totally clear on how to do it based on the documentation.

Jeff Eaton of Lullabot wrote a really helpful article on how to do basic caching in Drupal 7, which is a good introduction, but didn't really explain how to cache a bunch of related, but separately calculated, pieces of data using a function you'd call repeatedly. Examples module is also great, and does include a cache_example module, but also didn't have an example that was right up my alley.

So, here's how to write a single function that can be called multiple times on the same kind of object. This is not what you'd want to do for users or other built-in entities (for those, you should use Entity Cache module). Thanks to Planet Drupal readers for the feedback and help clarifying this.

Categories: 
Tags: 

Last night, I spoke at a joint meetup of Hollywood WordPress and LA WordPress 101. I called it "Everything I Always Wanted to Know About WordPress (but only learned through experience)", but the main point was to give people who are new (or newish) to WordPress some tips and tricks on how to use it, and ways to proceed when they need to start customizing it.

This is my recording of the talk itself, basically a screencast of the slides. The organizers also shot video where you can see me, and if I get my hands on it, I'll update this post.

Download the slides here

Categories: 
Tags: 

When migrating into Drupal from a CSV file (i.e. a spreadsheet from Excel or LibreOffice Calc if you're an open source nut like me), you use the MigrateSourceCSV class. It works very well.

Depending on where the CSV file originated, though, you might get unexpected behaviors, like Migrate UI telling you there are thousands of source fields you need to map. If this happens, and you don't have that many fields, check the line endings on your CSV file. Open the CSV file in your text editor and check its settings. Today, I was working with a file with the following settings (shown in BBEdit's status bar):

Character set and line ending settings shown in BBEdit

As you can see, the character set was Western (Mac OS Roman), and the line endings were Classic Mac. That means the file originated in Excel for the Mac, and it causes Migrate to freak out. I changed these settings to UTF-8 and Unix-style line breaks, saved the file, and from then on Migrate was happy.

There's also a parameter you'll see in the MigrateSourceCSV documentation called embedded_newlines. It's supposed to help with weird row counts, so I thought maybe that would help this issue, but apparently that's not quite it. It's not a big deal to resave the CSV file anyway, so that's what I'd recommend just to be safe.

Categories: 
Tags: 

This is Part 1 in a series of posts on migrating a site from Squarespace 5 into Drupal 7. This is an overview of what we're doing and why, mostly discussing the format of the Squarespace 5 XML file, which is undocumented. My hope is to make the process of importing Squarespace data easier for everyone else.

The Mission

I'm working on a fairly large site (ApertureExpert.com), currently running on Squarespace 5, migrating to Drupal 7. Squarespace is an excellent platform with many virtues, but it doesn't allow the level of customization that my client is looking for, so we're moving the site to Drupal. Now, of course you lose the built-in, high-availability hosting, and some of the very good polished UI that Squarespace gives you, so this move is not for everyone. But if you want control, and to have your blog, forums, and e-commerce wrapped up in a single package, Drupal is your friend. One example: my client wants users to have all their purchased products, forum posts, and comments available through their user profile. Squarespace can't do that, Drupal can.

This site has been active for several years now, and has a very active community of users, so the first big task was to import all of those items into Drupal. Fortunately, Squarespace 5 will let you export your entire website as XML. Note: it doesn't look like Squarespace 6 (the current version) supports full site export. There is a WordPress-compatible export that you could import into Drupal using WordPress Migrate (or, obviously, into WordPress), but it seems to cover only blog posts. This site is older, running Squarespace 5, so we can get everything.

Now that we have exported data, what can we do with it?

Categories: 

I gave a presentation at last night's LA Drupal meetup on migrating from Squarespace to Drupal. I'm writing a full blog post (maybe more than one) on the subject, but for now I want to post the slides.

Download Squarespace to Drupal: a migration adventure (PDF)

All the links in the PDF should be hyperlinked and clickable. There are also some XPath selectors and drush commands that might be useful. The full post on this topic is coming soon.

Categories: 

In my introductory WordPress course, in first video on WordPress security tweaks (the third video of the third chapter — it's one you need to have bought the course to see), there is some sample Apache configuration shown which is not included in the course files. This was an oversight on my part; we tried to provide everything you would need to save re-typing errors, and this one slipped through the cracks.

Categories: 
Tags: 

I work independently on many web projects, but I also partner up with other companies in various capacities. One of my longest-running partnerships is with [Nonprofit Tech][npt], which is now based in Madison, but was my first job when I lived in the San Francisco area back in the early 2000s. We've worked on a lot of different projects with many clients over the years, but one that has been consistent is [Consumer Action][ca], a consumer-advocacy organization based in San Francisco. They offer a wealth of information on the laws and industry surrounding credit cards, home buying, privacy, insurance, and a lot of other stuff; and they offer all this in many languages. They're good, and I'm happy to be of service to them.

Their website runs [ExpressionEngine][ee], and in the last year they upgraded to the 2.x version. There was a lot of work involved migrating their pretty massive online empire from 1.x to 2.x, because along with having a lot of content, they deliver it over a network of targeted websites (they call them subsites), not just the main Consumer Action website. I wasn't involved in a lot of the migration work, but I did work a lot on their publications store, which we switched from a homegrown system to the [Store plugin from Exp:resso][store]. The point of the publications store is to allow registered members (you can become an online member for free) to order printed copies of the publications, and everything is free thanks to Consumer Action's donors and corporate sponsors. We needed the system to support a conventional shopping cart experience, but with all products being free, and being able to use the existing publications channels so there would be no re-entering a bunch of product data. The homegrown system worked, but it wasn't robust, and after researching many options, we ended going with Store, and it did the trick. We migrated the main Consumer Action site to Store fairly painlessly, and got a nice increase in stability.

The trouble came when we wanted to set it up on [MoneyWi$e][m], one of the subsites. Consumer Action uses the ["classic" multi-site setup][cmsm], which predates the current Multiple Site Manager module, to serve its subsites. I'm not as well-versed on the history of ExpressionEngine as I am with other systems, but it's my understanding that the MSM didn't support easy content sharing between sites for a while, and that fact, combined with the additional license fee, was enough to keep this website away. The site has become large enough that migrating to the MSM was looking daunting, so with all the other migration work that had to be done, something had to give, and it was an additional MSM migration. These days, it seems to be assumed that any set of websites served from a single instance of EE use the MSM, so making this classic setup work with third-party add-ons can be tricky.

It took us a little while to nail it down, but Exp:resso were very helpful throughout the process. Here are the issues we faced and how we solved them.

Categories: 

I want to mention a couple small pieces of Mac software I use often, but think are very good: Dash and Pester.

I gave a presentation on child themes in WordPress tonight at the SoCal WordPress meetup, and it seemed to go well. Except for one thing: I left Screenflow in pause the whole time.

sad trombone

I promised to record this presentation, and I'm not going to let my incompetence get in the way of a promise. So here it is, re-recorded at home.

Categories: 
Tags: 

Pages

Subscribe to ShooFlyBuzz