Dec 31 2012
Dec 31

Make 2013 safer with a backup plan for your site

Ah, New Years Eve. It's the time for parties, reminiscing, and the old tradition of New Years resolutions. We promise ourselves we'll exercise, read that important book, donate to charity, or -- depending on the number of web sites we're responsible for -- vow that this is the year to set up a backup plan. Few things, after all, are more terrifying than the realization that a server hiccup has wiped out a web site, or a hasty change deployed to the live site has nuked important content. Fortunately, there's a module that can help. Backup and Migrate offers site builders a host of options for manually and automatically backing up their sites' databases -- and integrates with third-party backup services, to boot!

Screenshot of Backup and Migrate settings

Backup and Migrate offers a number of options for preserving your Drupal site's database, but all of them revolve around three important choices. You can choose to backup just a select group of database tables, or the whole kit and kaboodle -- useful for ditching the unwieldy cache and watchdog tables that Drupal can easily recreate. You can choose the destination for your backup -- drop it into a private directory on your server, download it directly to your computer if you're performing a manual backup, or send it to several supported third-party servers. And finally, you can run backups manually or schedule them to occur automatically.

In its simplest form, you can use the module to manually pull down a snapshot of a site's database for safe keeping, or to do local development with the latest and greatest production data. For real safety, though, you can tie it to services like Amazon S3 storage, or the new NodeSquirrel offsite backup service. Set up scheduled daily or weekly backups, tell it how long to keep existing backups around, and rest assured that regular snapshots of your site's critical data will be tucked away for safe keeping when you need them.

When disaster strikes, you can use the Backup and Migrate module to upload one of those database backups, and restore your site to the state it was in when the backup was made.

Screenshot of the Restore Backup screen

It's important to remember that Backup and Migrate won't solve all of your problems. It requires a third-party addon module (Backup and Migrate Files) to archive and restore the site's important file uploads directory, for example. In addition, the easy one-click backup and restore process can tempt developers to forgo safe deployment strategies for new features. Just because it's possible to download a database snapshot, do configuration work on your local computer, then re-upload the snapshot to the live server, doesn't mean it's a good idea.

That said, Backup and Migrate is an excellent tool that's proven its worth on countless sites. Its clean integration with third-party file storage services also means that it's a great transitional path towards a full-fledged backup strategy for business-critical data. If you aren't using it, check it out -- and enjoy the peace of mind that comes with keeping your site's data safe.

*/
Oct 09 2012
Oct 09

In the first episode of Insert Content Here, Jeff Robbins and I chatted about the temptation and the danger of the "Dreamweaver Field" content model. When content types are just wrappers around giant chunks of hand-formatted HTML, editors have lots of flexibility but it's all but impossible to repurpose the hard-coded content for new designs and publishing channels.

In presentations, articles, and her upcoming book, Content Strategy for Mobile, Karen McGrane describes the problem as a war of "Blobs" versus "Chunks." The challenge is figuring out how to decompose a site full of inflexible HTML blobs into discrete, bite-sized fields. There's no magic bullet (a model that works for one project can fail miserably for another), but over the past several years we've accumulated a few useful rules of thumb for "deblobbing" a site's content.

The Basics

Don't skimp on the content inventory and auditing process. Figure out what's there, what's going to be tossed, and what you want to have on the site. This is step zero, really: the modeling process is infinitely harder if you're dragging around piles of HTML that don't match what your're trying to build.

Clump similar content. If your existing site doesn't have discrete content types, figuring out which pages are similar to each other is the next stage. Product reviews, staff bios, press releases, blog entries, portfolio slideshows… You know the drill. Remember to look for pages and content types that are really composites of other, smaller units of content. Often, some of the most complex pages and content types can be implemented as rule-based or curated collections of smaller, more management content types.

Look for common "chunk" types. Once you've grouped your blobby content types into similar pools, zoom in and look for patterns that are unique to each content type. These are are potential candidates for dedicated fields. Some of the common field types we encounter include:

  • Links to related content
  • Links to downloadable files and embedded media that occur at consistent locations
  • Publication or event dates
  • Pull quotes, hand-written taglines, author bios, and summaries
  • Business and event addresses
  • Geographical locations and maps
  • Lists of information like features or rules and requirements
  • Ratings, prices, and product codes

Most CMS's support multi-value fields that can be used to model repeating elements like feature lists or multiple file attachments. Be sure to note which elements occur once, and which ones repeat.

Rinse and Repeat. Once you've broken things into multiple content types and identified the discrete fields on each one, look for overlaps. Are there several content types that share the same list of fields? Consolidating them into a single type might simplify things. Is there one "Godzilla" content type with dozens and dozens fields? It might really be several types that should be teased apart. The first pass of a content model is a lot like the first draft of an essay: there are always rough edges and awkward parts that need work.

The Tricky Bits

After identifying all of that easy stuff, large and complex sites usually have quite a few ugly blobs that still need to be broken down.

Identify composite content. Sometimes, elements of one content type need to be broken out into their own sub-content-types, with simple parent-child relationships connecting them. Galleries that contain multiple photos, albums that contain multiple songs, and curated pages that include teasers for other content are common examples. If several content types in your model contain the same cluster of fields (like photo, caption, byline, and link, consider splitting out the cluster into a its own dedicated content type. Treating those scenerios as relationships between discrete elements can often simplify complex models.

Look for common formatting complexities. If you have wireframes or existing pages, look for complex visual formatting around certain elements, in particular the stuff that requires lots of hand-written HTML to implement in a "content blob." Comparison tables are a common offender here. Breaking these out into dedicated fields whenever possible can help prevent massive pain when a piece of content needs to be displayed differently in new channels.

Watch for design elements that change based on context. If you're building a responsive or adaptive site, or have access to designs for mobile apps or other output channels, keep an eye out for elements that appear differently or conditionally based on breakpoints, target device, and so on. It seems obvious, but controlling small elements is infinitely easier when they're broken out as discrete fields.

Plan for searching and filtering. Try to identify as many different filtered lists of content as possible. Faceted search screens, topical landing pages, author-based blogs, product lists, and so on can't be built efficiently without the right data. If the lists and search indexes that you need don't correspond to fields you've already broken out, remember to add additional ones for the required metadata.

Isolate the crazy. Inevitably, complex designs end up requiring "helper" content that doesn't seem to fit the well-understood content types the site's stakeholders imagine. Slides for promotional rotators, free-floating promotional microcontent for landing pages… These tend to be highly variable and often need the kind of raw-HTML flexibility that we're trying to avoid. Isolating them in their own content types and living with the cordoned-off craziness can help simplify models with overloaded, field-heavy primary types.

Recognize when markup is good enough. Despite all the talk about the dangers of blobs, it is possible to go too far. Replacing every HTML div and span with a dedicated field simply to avoid raw markup is overkill, and can easily result in 'Edit Screens of Doom.' Modern WYSIWYG editors generally support plug-in systems, and developing a button to "insert caption here" or "style paragraph as warning" can be a simpler solution. This is where I repeat the warning: There's no perfect content model, only the one that works for your project.

Test the Model

The long-term impact of a bad model on a site's maintainability can be frustrating, but it's also impossible to predict every future application the content will be used for. Iteratively testing the model against real-world content and potential applications is critical.

Put real content into the model. It seems obvious, but it's easy to go down the structural rabbit hole and forget the existing pool of content. Circle around frequently and ask, "How does the content we have in hand fit into these content types and fields?" Look for odd mismatches, required fields that the existing content will leave unpopulated, and so on. Sometimes, the design and the model have to change for practical reasons. Other times, clients or your team will have to update the content to close the gap.

Plan for three channels. When building a model (or a software API), it's easy to imagine you're creating a reusable system while unintentionally baking in assumptions that make real reuse difficult. If you need content that will adapt to reuse in new channels, be sure that you keep at least three in mind -- think of them as user personas for the model. Desktop web, small-display devices, and rich HTML newsletters are common answers for some businesses. Even if you're only building one of them at first, proposed approaches can be compared against them to ensure you aren't painting yourself into any corners.

Social sharing is a publishing channel, too. Twitter and Facebook can automatically embed headlines, summaries, and preview images when users paste one of your site's links -- if you provide the metadata that they're looking for. If your model doens't account for those, it will be much tougher.

Let real users work with it. If you're using a web framework that allows rapid creation of a content model before the full site is finalized, or you can produce wireframes of some sample content input and editing screens, get user feedback sooner rather than later. The people who spend their time creating and maintaining the content can often spot problems and inconsistencies that would otherwise remain undiscovered until launch.

No Rules, Just Lessons

None of above ideas are hard-and-fast rules, obviously. At Lullabot, we've spent years building out complex sites (and the underlying content models) for media publishers, government agencies, corporate intranets, ecommerce sites, and more. And yet, every new client comes with surprises and challenges.

In the coming months, I'll be digging deeper into each of these ideas with follow-up articles and interviews on Insert Content Here. In the meantime, what useful heuristics do you use when breaking down ugly "content blobs" into reusable chunks? Feel free to chime in with comments!

Jun 07 2012
Jun 07

Login to a Drupal site without getting lost

There are a lot of different ways to configure login with Drupal. You can add a block to every page with a username and password field, a practice which I find to be ugly and distracting for anonymous site visitors. You can collapse the login block with Javascript using a module like LoginToboggan. Or you provide a link to the login page in your navigation menu somewhere. If you create a link directly to user/login, then this item will disappear for logged-in users since they don't have permission to visit.

However, due to a limitation in the menu system, most Drupal sites don't add a destination query to the login URL. This is what a Drupal URL with a destination query looks like:

http://example.com/user/login?destination=path/to/this/page

The Drupal form system uses this query to direct the user to this destination after submitting a form - like the login form for example. Without it, most Drupal sites will redirect the user to their profile page after logging in.

So Drupal's default workflow tends to go like this: 1) I find the page I want to edit. 2) I realize I'm not logged in. 3) I hit the login link. 4) I log in. 5) I'm on my profile page. 6) I curse and try to find my way back to the page I wanted to edit.

This is compounded on sites like the one you're reading right now, because we don't have a login link in our navigation. It's our site and honestly, we don't want you logging into it. :-)

So how do we solve this problem for all of the ten gazillion Drupal sites out there?

Enter Jeff's Handy Dandy Drupal Login Bookmarklet! This Javascript bookmarklet will figure out if you're on a Drupal site, figure out the base path of that site (in case Drupal is installed in a subdirectory), and then redirect you to the login page with a destination query to bring you back to the current page.

Just drag this link into your browser's bookmarks bar, visit your favorite Drupal site, and click it!

For those of you interested in tweaking this sort of thing, here's the Javascript source code:

(function(){
  if (typeof Drupal != 'undefined' && typeof Drupal.settings != 'undefined') {
    var u = false;
    if (typeof jQuery != 'undefined' && jQuery('body.logged-in').length) {
      if (!confirm("It looks like you're already logged in. Continue?")) {
        return;
      }
    }
    var l = window.location;
    var h = l.hash || '';
    var s = l.search || '';
    var b = Drupal.settings.basePath;
    var p = l.pathname.slice(b.length) || '<front>';
    window.location.href = l.protocol + "//" + l.host + b + "index.php?q=user&destination=" + escape(p + s + h);
  }
  else {
    alert("This doesn't appear to be a Drupal site.");
  }
})();

Updated June 12, 2012 to add support for <front> and check of logged-in body class.

You'll need to escape it as a bookmarklet before using it as a bookmarklet though. TextMate has a nice function to do this automatically.

Apr 01 2012
Apr 01

The merger to end all mergers!

Today starts a new month and a fresh beginning for Drupal. After many discussions over many drinks at DrupalCon Denver, we’re proud to announce a strategic inflection point for the Drupal community. As of today, the following companies will be merging into one company - a new formidable force in the Drupal community:

These 13-ish independent companies will be joining forces to form a new paradigm-shifting meta-company: Bluemarine Synergistics. Employing over 850 individuals spread out across eight continents, the company’s name combines the popular and much-loved Drupal theme with the word “synergistic,” implying strategic partnership, enterprise-empowered logistics, and e-business efficiencies.

Finally, Drupal will have a single dominant company for enterprise customers to be their long term partner. By combining so many Drupal companies into a scalable, virtualized talent cloud, we can make it easier for customers to find us – they won’t need to shop around. And we can have a single, unified, sponsorship presence at DrupalCon and Drupal camps. It’s not only good for Drupal, it’s good for the Drupal community! Just think of the parties a company of this size can throw. It will be a lot of free beer – free, as in free beer.

With estimated combined revenues of $1.21 billion, Bluemarine Synergistics will be expanding over the coming year, hiring a 200-person sales force to create a giant “Drupal tuna net” to capture companies in new verticals such as cosmetics, agriculture, Amish social organizations, multilevel marketing, “waste management,” adult entertainment, online file transfer services, and even the hunting and fishing industries. It turns out that there are many companies, even entire industries, not yet using Drupal. For instance, the aging baby boomer population represents a huge market not yet tapped by Drupal. Bluemarine Synergistics will attack the baby boomers.

“We believe that there’s a great deal of money to be made here,” said former Lullabot CEO Jeff Robbins. “It turns out that everyone wants a website. Drupal makes websites! Bluemarine Synergistics can make your website for you, even if you’re old or Amish or whatever.”

“It’s amazing how quickly it all came together,” exclaimed Ben Finklea, former CEO of Volacci who will hold the title of Social Media Intern for the combined company. “Almost all 13 or whatever CEOs happened to be at Rock Bottom Brewery one night during Drupalcon Denver. We started doing tequila shots and yada, yada, yada – we merged! My title has changed but my job is basically the same as it always was.”

“Twice in one month... WE LOVE MERGING!” said Michael Caccavano, former President of Phase2, former CEO of Treehouse.

“Mergers are our way of showing we care about each other. We could just hang out at DrupalCon twice a year, but this way we are together all the time.” said former Phase2 Technology CEO, Jeff Walpole.

“This company has a lot of promise. It has a bright future, but I’m also proud that we’re looking back and rediscovering some of the best elements of our past. We always felt removing Bluemarine from core was a step backwards. It’s just so affirming to be a part of this giant leap forward,” said former Gorton Studios CEO Drew Gorton.

Glenn Hilton, the former CEO of ImageX Media added, "It's a great move for ImageX. All the clients we lost to our competitors, we've now gained back."

“We used to lose sleep at night, praying that potential clients would fax us their Drupal project RFPs. Now, with our powers combined, none of us will ever go hungry again!” – Aaron Stanush, former partner at Four Kitchens and newly appointed Strategy Strategist at Bluemarine Synergistics.

“Originally, our promise to the Drupal community was that we would exclusively focus on professional services. In only a couple weeks’ time, we realized that customers would appreciate a comprehensive offering that includes infrastructure. Pantheon is proud to consider itself a cornerstone in fulfilling the Bluemarine Synergistics promise. Can you put ‘cornerstone’ in italics for the press release? Thanks.” – David Strauss, former CTO at Pantheon Systems.

"All of the former Aten Design Group team members are ecstatic about becoming a part of Bluemarine Synergistics. The BS product line is so bleeding-edge. Who can say no to the 24-hour-a-day website package? Just think about it – websites, any time of the day." – Jon Clark, former Business Development Director at Aten Design Group, now Assistant to the Director of Execution, BS Products Division.

Bluemarine Synergistics finally solves the “coopetition” problem once and for all. We’re all friends. We’re all working on the same software. Why do we need to compete for employees? Why do we need to compete for clients? Heck, why do we all need to decide what to charge? Think of all the good we can do if we just band together! One big company running Drupal for the good of everyone – that’s Bluemarine Synergistics.

Company headquarters are currently being built on property located approximately two miles west of New Amsterdam, Indiana – the geographic center of all the previous headquarters when weighted by employees, revenue, and contributions to Drupal core.

Please share your excitement about Bluemarine Synergistics on your favorite social media outlets. Use the hashtag #bs4drupal because Bluemarine Synergistics is B.S. For more information, please visit http://www.bluemarinesynergistics.com. Thanks!

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web