-
Drupal 8: Consumption of a Third-Party API
For a recent project, we were tasked to consume the client's internal data from a custom API. Now, this scenario was lucky for us, the API provides a total item count of about 5000, but when queried with a start date, it provides all...
-
Programmatically Importing Drupal 8 Field Configurations
Sometimes during development, a chicken and egg situation happens when business logic intersects with Drupal's mechanisms. For instance, a custom module, client_business_logic, is built to handle some unique, abstract bit of logic which depends on a taxonomy vocabulary
-
Sluggish Drupal 8 Adoption Lags Even D6
We're just past the second anniversary of 8.0.0. To see how D8 is doing compared to prior releases, we put together the chart above, based on Drupal's usage stats page. For versions 5.x, 6.x, and 7.x, each new release brought dramatically accelerated growth...
-
Drupal 8 Entity API cheat sheet
Wait, is it "$node->title" or "$node->title->value"? How do I write an EntityQuery again? Yeah, I can never remember, either.
-
Drupal 8: Migrating data from JSON files
The beauty of Drupal 8's built-in Migrate module is its flexibility. Lots of people will likely use it to migrate their Drupal 6 or 7 sites, but that's not all it can do. In fact, it's capable of migrating data from just about any data source PHP can read...
-
Secrets to Project Happiness Using Git
I have worked with dozens of projects over my career, on platforms ranging from Drupal to Yii to Django to AngularJS to ASP.NET.
-
Extending Drupal 8 Fields That Contain Data
Data protection is one of the primary advantages of Drupal, but sometimes there are exceptions to the rule and you might need to modify a field to account for some change in business needs. There are a few rule bends...
-
Avoiding Drupal 7 #AJAX Pitfalls
Rather than provide a basic how-to tutorial on Drupal's form API #AJAX functionality, I decided to address a few pitfalls that often frustrate developers, both junior and senior alike. To me, it seems that most of the problems arise from...
-
Science is Beautiful: The New Schrodinger.com
Metal Toad has the distinct pleasure of working with some truly great clients representing a diverse array of industries.
-
UNFI Launches a new Product Information Manager
United Natural Foods, Inc. (UNFI) launched an incredibly sophisticated Product Information Manager (PIM) for Blue Marble Brands in June.
-
Ziba.com Reborn
Metal Toad has been blessed to work with some of the best design partners in the industry, not the least of which is Ziba.
-
What I Learned Today: Views Plugin Debugging
As I've said before in my custom views filter handlers tutorial, views is amazing. Today I was writing a custom style plugin.
-
Search by Content Type in Drupal 8 - a custom module tutorial
At the time of this writing, the Search API module is still in alpha phase. A note from the module maintainers warn that it is unstable. This blog post serves as a way to learn how to write a simple Drupal 8 module to
-
Upgrading Drupal Media module to 7.x-2.x
I recently spent some time fighting against the Drupal Media and File Entity modules in order to upgrade them from version 7.x-1.x to 7.x-2.x.
-
What I Learned Today: Check Your Default Google Analytics Settings
Google Analytics Module Settings
-
Anatomy of a Drupalgeddon attack
Before working at Metal Toad, I saw an email from Acquia. A strange email. It went something like this: On October 15th, we will be addressing a security concern at 9:00 am.
-
Consultant Hobbies: Being Social
Hi Internets.
-
Amazon CloudFront with Drupal 8
Since I wrote my first review of CloudFront, Amazon has added support for three essential features...
-
Drupal 8 Migrations, part 4: Migrating Nodes from Drupal 7
Drupal 8 provides a flexible, plugin-based architecture for migrating data into a site. In Part 3 of this series, we explored how to migrate taxonomies from a Drupal 7 site. We will now expand on this by migrating basic nodes from a Drupal 7 site into Drupal 8.
-
Drupal 8 Migrations, part 3: Migrating Taxonomies from Drupal 7
Drupal 8 provides a flexible, plugin-based architecture for migrating data into a site. In Part 2 of this series, we explored how to migrate users from a Drupal 7 site. We will now expand on this by migrating Taxonomy vocabularies and terms from a Drupal 7 site into Drupal 8
-
Drupal 8 Migrations, part 2: Migrating users from a Drupal 7 site
In this article, we will be building a custom migration which will import users from a Drupal 7 site into a Drupal 8 site. The migration will include the standard user profile fields like username and email address, plus a few custom fields added to the user profile.
-
Migrating Content into Drupal 8
Drupal 8 includes a powerful built-in migration system for importing content into your site. It is designed to handle data from Drupal 6 or 7, and much more. It is built around a plugin-based architecture, which allows importing of data from any external data source if you write your own source plugin.
-
Drupal 8: First Impressions for the Back-End Developer
Drupal 8 is in beta now, and recently I’ve had a chance to start working with it. While much of the admin interface is comparable to Drupal 7, there have been some important changes for site builders and back-end developers. In this post, I will be looking at file system and database structure changes, Drush setup, and the new configuration entity type.
-
ToadCast 028
For ToadCast 28 we have special guest Chris Bloom! Chris teaches our Director of Development Dan Linn, about new Front-End technologies.
-
The Challenge to Innovation
Recently inspired by Peter Thiel's excellent book Zero to One, I've been reflecting on the software industry as the preeminent place where we can expect to see radical innovation - and the blockers that exist in the industry that need to be addressed for us to maximize the pace of change.
-
Simple password grants with OAuth 2.0 and Drupal
Like many Drupal developers, we have become big fans of decoupled front-ends using Drupal as a RESTful backend (a.k.a. "headless" Drupal). The myriad of authorization options can be confusing, however. We've settled on OAuth 2.0 for most situations. When OAuth is brought up, many people will think of the single-sign-on flow in a browser, with the associated redirects and permission dialogs. This flow is widely used, but not always a good fit for first-party applications, or machine-to-machine API interactions.
-
Team Communication Styles and Dynamics
Here's the sixth post in my series following the session I presented at Drupalcon Austin, entitled "Oh look, we're growing!" This post goes a bit deeper into a framework for
-
Drupal 7 Form API: Using #states with multiple conditionals (AND, OR and XOR)
I've been playing with D7 forms lately and have found #states to be somewhat challenging due to lack of documentation on Form API page. I've poked around a bit and decided to write a blog with my findings in case someone else is in need of this info down the road. If you are looking for a robust solution for conditional fields, I would suggest looking into
-
Attack of the PHP clones: Drupal, HHVM, and Vagrant
For those wanting to give it a spin, Metal Toad has added HHVM support to our Vagrant box: github.com/metaltoad/trevor.
-
Drupal Solr Search with Domain Access filtering
Metal Toad has had the privilege to work over the past two years with DC Comics. What makes this partnership even more exciting, is that the main dccomics.com site also includes sites for Vertigo Comics and Mad Magazine. Most recently Metal Toad was given the task of building the new search feature for all three sites. However, while its an awesome privilege to work with such a well known brand as DC, this does not come without a complex set of issues for the three sites when working with Apache Solr search and Drupal.
-
The Best Way to Learn Programming for Beginners
What's the best way to learn programming for beginners? What makes the difference between the people who knock things out of the park vs those who struggle?
-
Please don't abuse node references! Part 2
Welcome back to the second part of "Please don't abuse node references!"
-
ToadCast 023 - Drupal Con Austin 2014
Photo Credit: Tyler Ward In Toadcast 23 we talk with Tom Martin and Dan about Drupalcon 2014, Texas Food, Heat, Sessions from Four Kitchens, Adam Edgerton, Roaches, Austin City Life, Pet Talk, Presentations by Dan, Drupalcon 2015, The Definition of Decimate, Future of Drupal, & Expansion of Drupal Crowd.
-
Drupalcon Austin: Toads in Texas
Turns out that Toads migrate south in the summer. At first, we assumed this was some instinctual need to get as close to the sun as possible. But then we realized it was just the bright beacon of Drupalcon drawing us in. We must obey our master.
-
Please don't abuse node references! Part 1
Welcome to the first part of a two part article on a terrible way to use node references, how it was fixed, and the troubles implementing the solution. In this post, I'll provide some background on the problem encountered and talk briefly about the proposed solution.
-
ToadCast 022 - Open Source and Cover Oregon
Toadcast 22 hosted an All-Star cast including: Dave Bellous, co-owner of Yellow Pencil, Jacob Redding, Open Source Manager at Accenture's Emerging Technology Innovation Labs, Jeff Walpole, CEO of Phase2, and Joaquin Lippincott, President of Metal Toad Media to discuss Open Source, Oracle, and and the healthcare web-tech industry (Cover Oregon).
-
Pond Life Ep.2
Hello Everyone!
-
Drupal 7: When to use Entityqueue vs Draggable Views
This post was inspired by a question our VP Tony asked me while I was working on Entityqueue, he asked, "how is it different from Draggable Views?" At first the answer isn't as obvious, they both allow you to sort items in a list.
-
Drupal 7 Tutorial: Using Entityqueue with Views
Last time I gave a quick introduction on how to create and manage queues using Entityqueue. This time I'll show you how to use them with Views to display content sorted by their position in the queue.
-
Drupal vs. WordPress? Who Cares?! They Are Both Open Source.
Every week I hear about someone choosing WordPress over Drupal (or vice versus). While there are certainly differences between the two platforms, they are more alike than people typically care to admit:
-
DrupalCon 2014 Call for Sessions!
It's that time again! DrupalCon is right around the corner and it's time to submit your talk. The theme this year is Drupal 8 and that means that we'll be covering things like Symphony, Twig, and the other new components that make up Drupal 8.
-
ToadCast 021 - The Drinking Game!
For Toadcast 21 we interview the man, the legend, Jonathan Jordan. For our 21st we did what any good podcast would do, we celebrated with a drinking game. Hear all the great questions and answers by listening!
-
Reliably Monitoring MySQL Replication
Replication is a wonderful thing for your clients. Having a 'hot spare' of their database(s) for redundancy, or being able to off-load read operations from the main database to increase performance, giving your client peace-of-mind about their data and application.
-
The 2013 Emmys Leverage AWS
When preparing for a big event, it is our job to make sure the general public sees exactly what is expected, and with the help of Amazon Web Service (AWS) we did! All planning comes with a few standard issue assessments/steps: Identify need, identify options, and begin to build!
-
Ruby, Drupal and a tadpole's swimlane
Entering the pond
-
Drupal 7 Tutorial: Using Entityqueue
Now that Entityqueue has been released, I wanted to give a quick tutorial on how to use it.
-
The Drupal Entityqueue Module
If you're familiar with the Nodequeue module and you wanted to create a queue of other entity types, like users or terms, then you would have to install another module, like
-
What I Learned Today: Drupal #attached Awesomeness
What is #attached
-
Why More People Select WordPress than Drupal to Build Websites
First off, Drupal has had a great year and a great quarter. According to builtwith.com Drupal is second among all Content Management Systems at 13.75% of the top 10K websites and has added ~250K new website this quarter.
-
What I Learned Today: Drupal Behat Scenario Cleanup
I've been doing a lot more Behat testing recently. As my tests have gotten more complex, I've discovered that it was only a matter of "luck" that my earlier tests were properly cleaning up after themselves.
-
What I Learned Today: Drupal Behat Breakpoints
Today I learned that the Drupal Behat Extension provides an extremely useful step definition for debugging. Breakpoints!
-
New Relic Real user monitoring hooks for Drupal
If you are using New Relic for performance monitoring a Drupal project, you may have noticed a large discrepency between the browser throughput and app server throughput. In the example that follows, the difference is 100:1. The cause is a limitation in the auto-instrument feature:
-
Fixing a segmentation fault in Drupal
"[notice] child pid 45617 exit signal Segmentation fault (11)": This is usually the start of a very bad day. Since a segfault is a low-level error in native machine code (in this case the PHP interpreter), many typical debugging techniques don't apply. Today I decided to try something new:
-
The Emmys Chooses Drupal 7
For those who watched the Primetime Emmys last night the content management system (CMS) used to support the website probably didn't matter all that much. That's because the site just worked, despite a heavy load of over 3 million page views (with a peak in a single hour of over 500,000). Behind the scenes the site is the result of a lot of hard work from...
-
Regex for Quoted String with escapable quotes
Metal Toad is an AWS Managed Services provider.
-
Puppet Labs Chooses Drupal
Puppet Labs launched with an amazing new responsive website, powered by Drupal. The site is a power-user's dream and allows for drag-and-drop GUI configuration of the mobile, tablet and desktop versions - all within the browser.
-
You Should be Paying More Than $50/month for Hosting.
In the year 1999, if you ran a business and you had a website, you were ahead of the game. It meant that in addition to finding you in the Yellow Pages (where most people still looked) you could also be found on the "World Wide Web".
-
Samsung Music Chooses Drupal
SamsungMusic.com (formerly Samsung Music Hub) launched earlier this year pushing the boundaries of HTML5 and responsive web design. It was designed to work (obviously) across a large number of Android devices, with the animations taking full advantage of the built in GPU acceleration available on many mobile devices. The design was done by our awesome partners at Oakland-based
-
Drupal Debugging: Clues from the Database
Have you ever chased a bug down a rabbit hole and spent a few hours down there only to come back up for air thinking "why, oh why does the bug taunt me"? If you have then you know that every clue can count. Any given clue can send you on the shortest path from A to B, or it can send you spiraling. When looking for clues always remember that your code is not the only place to look. Sometimes valuable hints can be gained from the database as well.
-
Sound Bytes from Drupalcon Portland
First off, yes, I realize it's "sound bite", but given the context, "byte" sounds more applicable.
-
DrupalCon Pre-Show and announcements
Here we go! Portland's Drupalcon is here. Here is a quick update about some of the exciting things that Metal Toad is bringing to the event. Stop by our booth (#207) and come party with us Tuesday and Wednesday. Come watch us record the podcast live and even step up to the mic if you dare. T-shirts, wine, stickers, foosball, Drupal!?!?! Whoa.
-
Site Administration: Remember the Admin
Meet Jake. Jake administers a Drupal site. Jake is not a developer, nor does he want to be. Jake does not care about field formatters, image styles, or even draggable views.
-
Passing Page Arguments to View Panes
Recently I was faced with the task of passing off multiple page arguments to a view pane, which seems simple enough after you have done it once, but the first time around I found myself wading through settings for far too long.
-
ToadCast 015 - ECommerce
Joining me for Toadcast 15 is Tom Martin to discuss ecommerce. That's right, a show all about a single topic!
-
Receiving Git Attribution for Your Drupal.org Patches
If you contribute patches to the Drupal issue queues, you often spend a lot of time and hard work getting that patch through the review process. Even though we do it for the good of the community, once it is all said and done, it's nice to get a little acknowledgement.
-
ToadCast 014 - Everyone's got a phone and a toilet
Joining me for our 14th ToadCast is Chris Trahey where we talk about doing what is right for your clients and the benefits of developers as technical sales. We also discuss notification overload, the anxiety surrounding a desire to know everything, and managing your todo list.
-
Drush pm-download and pm-update: When and Why to Use Each
Drush is a Drupal developers Swiss-army knife. Of course there are the favorite commands that you probably use every day: drush sql-cli, drush pm-enable. Drush pm-download and drush pm-update are probably pretty commonly used as well.
-
How to Fix Caching for Views With Exposed Filters in Drupal 7
One of the better features of the views module in Drupal is the ability to cache your view's output. This can come in handy when your view is doing a lot of computation. Caching your view will save your server a lot of unneeded work.
-
Open Source is the New Microsoft
When I was starting out in the web industry back before the turn of century, open source options were available but were often ruled out as risky business investments. At the time, they were relatively feature poor (compared to enterprise solutions) and a bet on the wrong technology could potentially cost someone their job. It was around this time that I heard the phrase "no one gets fired for choosing Microsoft", but times have changed.
-
ToadCast 013 - Apps, Contests, Calling people out, and My Bloody Valentine
Baker's dozen! Shortest episode ever. For ToadCast 013 I was joined by Tyler Ward.
-
How to Improve Your Reputation as an Open Source Provider
If you are as open source service provider (Drupal, etc) you have a distinct advantage over many peer in the web development arena. With open source you are leveraging tens of millions of dollars worth of software and bringing that value to bear on even the smallest project you work on; you are part of a vibrant community that has drawn (and continues to draw) both amazing development talent and high-profile customers, who look for your services by name. All of that said, there are some things a CMS like Drupal doesn't bring to the table, and those elements are critical to improving your reputation in the field. So what are those elements?
-
ChickTech High School Workshop
All developers know the feeling of accomplishment that comes with completing a tricky section of code. To me that feeling is a distant second to the accomplishment felt when teaching someone else the joys of this hobby/career that I hold so dear. This past weekend (Jan.
-
Drupal 7 Tutorial: Customizing Services Input and Output format
Recently I was working with the Drupal services module, and ran into a few hang ups. For my project I needed a rest service that could export xml that matched a specific format, and consume xml and store it in the database for later processing. To do this I created a custom services resource, this was pretty straight forward. I found a few really great sites that explain how this is done. This one in particular is quite helpful. It was when I attempted to customize the output and input that I ran into some hang ups. When attempting to research more about how it is done, I found very little information posted anywhere. In this brief tutorial I will outline how I was able to achieve my goals, and hopefully save you some time.
-
How (and Why) Google Needs to Invest in Open Source
As more and more people start using the internet, and as websites get increasingly full featured Google continues to see growth in its userbase. Open Source CMS platforms (Drupal, WordPress, etc.) are increasingly the go-to technology for many companies with over 800,000 sites using Drupal or almost 60 million on WordPress. As big as these numbers are, they are a drop in a bucket compared to the 4+ million Google searches that occur each day. So why should Google care?
-
Site Building at DrupalCon 2013 in Portland
I'm very excited to announce that papers are now being accepted for DrupalCon 2013 in Portland!
-
Drupal 7 Tutorial: Using Breakpoint Panels
This tutorial is obsolete for the new version of Breakpoint Panels - New tutorial to come
-
Crafting an Apache Solr Schema.xml
Using Apache Solr with Drupal is fairly simple thanks to the apachesolr module, but recently we were tasked with making Solr a vital component of a custom Django project.
-
ToadCast 012 - Git, Drupal, WYSIWYG, and Metal Toad University
A dozen podcasts! For ToadCast 012 I was joined by Dan Linn and Dylan Tack.
-
ToadCast 011 - Drupal, BADCamp, and dev tools
This time on ToadCast 011 I was joined by Dan Linn to discuss Drupal, BADCamp, dev tools, and more!
-
Improving Our Use of PHP Namespaces
Let's take a minute to step back and think about why we use namespaces, and how to use them to improve code quality. I suspect there's a lingering hesitance to embrace their usefulness.
-
How to Pass Multiple Values through an Exposed Filter in Drupal Views
I regularly work with Views and recently I have had a few odd needs. One of which was when a user selects an item, that item then disappears from the view. The view has exposed filters with AJAX turned on. Since I don’t know how many items I’ll need to filter, I’ll need...
-
Faster Database Backups via Drush! Plus Capistrano Integration
When working with Drupal sites, Drush is your go-to tool. This post is going to focus on the drush sql-dump command. This allows you to export your database to a sql file, so you can restore it later. This can be particularly useful when you are working in a development environment and need to deploy a site to production for the first time. Or when you start work on a new clients existing site, you need to export their live database and download it to your local environment.
-
Quick Tip: Dive Into Drupal Objects with Search Krumo
If you've done any signifigant development with Drupal, you're probably (deeply) familiar with a little function called dpm(). I think it stands for Drupal Print Message.
-
Using Amazon Cloudfront with Drupal
We like to use our own site to experiment with different technologies. CDN's are nothing new, and Metal Toad has projects running on competing systems including Akamai and Level 3. Still, I think Amazon Cloudfront is an interesting offering and I wanted to give it a spin. Here's my review of the service after setting it up with Drupal:
-
Quick Tip: Clean Up Your Drupal Modules Folder
Let's say you inherit a Drupal site and the modules folder looks like this: And being an organized dev, you'd rather it look like this:
-
How to Jumpstart Your Programming Career
If you've felt yourself stagnating as a programmer recently, I have a cure for you. That's right, a ticket out of the back room or cubicle you've been stuck in for the past few years, into an exciting world that is changing daily. The secret is joining an open source community. This is a step-by-step path to making more money AND having more fun at the same time. It may not always be easy, but doing something worthwhile almost never is. Here's how:
-
New Competition: Will WordPress and Drupal Learn to Share?
After years of building and publishing on them, I'd love to say I knew CMS frameworks like Drupal and WordPress would be this huge. In truth they got this popular because of their great open-source communities; both of which I'm trying to participate and contribute to more. Why? Because closed platforms like SquareSpace and Adobe's content platform are rushing ahead without having to worry about backward compatibility like WordPress and Drupal does. These newer, closed systems insulate users from the backend and abstract away many of the same complexities WordPress.org and WordPress.com solved. They can push forward faster with newer, cleaner, “from-scratch” user-experiences because they don't need to maintain compatibility like "the big PHP" CMS's.
-
ToadCast 007 - Like a Boss
Here it is! ToadCast #7, I was joined by the owner of Metal Toad Media, Joaquin Lippincott to discuss standards, browsers, Mars rover Curiosity, Portland Drupal Consortium, and more!
-
Drupal's Big Data Problem
When we in the Drupal community talk about scalability, it's most often in terms of handling high numbers of visitors. An equally important dimension, that to our detriment we often overlook, is scaling with larger datasets.
-
Agile Resource Planning at a Fixed-Bid Drupal Dev Shop
On any given month, Metal Toad Media will distribute the work for 25-30 different clients across 10 different development resources. The majority of our work comes from fixed-bid contracts, but we also have a number of time & materials maintenance contracts to fill in the gaps. We've tried many different software solutions over the years to coordinate this work, but we've settled on using our own set of customized Google spreadsheets to do our long-term resource planning and short-term work allocation in a very dynamic and agile fashion.
-
ToadCast 006 - Google Fiber, OOCSS, and some nostalgia
ToadCast #6, I was joined by Dan Linn to discuss Google Fiber, MTV (unexpectedly), personal audio devices, cool javascript projects, and CSS.
-
How I got Twitter, UNIX Timestamps, and Drupal 7 to all play nice
Recently I had an opportunity to work with Twitter module for Drupal 7 on one of the projects. Most of the functionality I needed for the project was already available within the module and with few tweaks here and there I can get the task done.
-
How to Write Drupal Update Scripts
This is the second part in my two-part series about Drupal update scripts, specifically focusing on using update scripts for your custom modules as part of your
-
Creating a Custom Panels Layout in Drupal 7 (Video Tutorial)
There are a lot of great tutorials on the web and, as Chris pointed out, Drupal is a pretty developer friendly platform. With some chutzpah and the power of Google, you can build just about anything in Drupal.
-
Why You Should Spend the Extra Time to Write Drupal Update Scripts
Drupal update scripts are a great way of automating database updates. They are extremely important to contributed modules when changing the database schema and updating existing data to the new schema.
-
ToadCast 005 - We'll Do It Live
ToadCast #5, our first live podcast and I was joined by Adam Edgerton and Mike Bijon.
-
How Drupal is more welcoming than WordPress
I think we've all heard a few things about how Drupal and WordPress compare to each other. One thing I haven't heard much about is the "please contribute, here's how" factor to Drupal and its modules and the lack of it in the WordPress community.
-
Mobile Drupal optimization results
Our responsive redesign has been a great improvement for metaltoad.com. I was still not entirely satisfied with the speed of our site, especially while waiting for my train at the busy Pioneer Square! One of the major obstacles for mobile networks is lag, and so I set out to cut down the number of HTTP requests. By improving the site's stylesheets and scripts, I was able to eliminate a dozen extra requests.
-
Drupal Views now supports queries of Google Analytics report data
Views 3 now supports queries against Google Analytics.
-
Sprinting to Drupal 7 - Interviews with the Drupal.org sprint team
It was sprint time last week here in Portland, where over 20 people came to upgrade Drupal.org up to Drupal 7. There were 5 different teams focusing on different aspects of the project: infrastructure, Git, Project module updates, general upgrade of Drupal.org specific modules, and making the Bluecheese theme responsive.
-
PlaceZombies.com!
Who can resist zombies? They’re everywhere! But on the internet, they are facing an uphill battle against the kittehs. They were dealt a heavy blow with the release of placekitten.com which allowed developers of all sorts to add kittens to their site with a simple URL. But now the zombies are ready to strike back. U CAN HAZ ZOMBIES!
-
DrupalCon PDX 2013 Kick off!
Countdown to DrupalCon initiated! Metal Toad went to the kickoff meeting for DrupalCon 2013, which is taking place right here in our fair city of Portland, Oregon. Portland is full of people who are enthusiastic about open source software, and Drupal in particular.
-
How I Lost 10 Pounds on the DrupalCon Diet
-
Learning Better Dev Skills by Programming in Public
Learning to develop professionally involves a lot more than just writing code. Major required skills include keeping code stable long-term, sharing tasks within a team, and building understandable interfaces so your code can be connected to and run from other programs.
-
Handling long-running background tasks in Drupal 7
In my previous post, I discussed how to import a large dataset into Drupal via Drush's batch API. In this blog post, I'll cover how to create background tasks in Drupal 7 that will take long amounts of time to finish.
-
Using the Drupal Batch API
Recently I was working on a site for a library that had a lot of data that needed to be imported into Drupal as nodes. Each book title, e-book, DVD, etc. needed to be a node inside of their Drupal 7 website. Not only that, but...
-
A quick look at CSS3 animations
CSS3 animations are finally becoming a useful tool in the front end developer's kit! Browser support is progressing, however there is no IE support yet (surprised?) and Opera currently doesn't support animations, but may in the future.
-
Custom Sort Drupal Content with the Draggable Views Module
In the world of sorting, sometimes 'newest first' or 'oldest first' just doesn't cut it. During a recent Drupal project, we had a client who wanted to be able to control the order of their marquee images in random ways via a drag and drop interface. Enter the Draggable Views module. In about thirty minutes, I was able to set up custom drag and drop functionality for several content types on their site. Let's dive in and I'll show you how it's done. If you prefer a video tutorial, skip to the end of this post.
-
Boilerplate 1.0 for Drupal 7: Responsive HTML5 & SASS
Great HTML5 support based on the excellent Boilerplate HMTL5 template, full SASS support, and a base fixed/flexible responsive layout similar to Zen but with built in mobile support, all while keeping the code
-
Using Drupal Contextual Filters in Views
It can take a while when you're new, but once you start to wrap your head around Views, that is when Drupal gets really fun. In this tutorial, I'll go over how to use Contextual Filters in Views to alter your content dynamically based on information in the URL. If you're a visual learner, you can skip to the video at the end of this post for a detailed walk through of the process.
-
Integrating Compass with a Git / Capistrano deployment workflow
When we added the Compass CSS authoring framework to our projects, new wrinkles appeared in the deployment process. Committing the artifacts to Git was used for our first prototypes, but is unsuitable for team projects because it's a sure-fire way to introduce merge conflicts. Running compass on the server (either with Cap or the Drupal module) is appealing, but a minority of our projects deploy to hosts without the ability to install Compass. Rather than support multiple strategies, we decided on executing Compass locally on the workstation running Capistrano. Changes are needed to several files:
-
How to Become a Web Developer
So you want to become a web developer? Smart move. The web is a growth industry and I don't know of any university curriculum that adequately prepares people for this career. A good web developer can pull in well more than the median annual wage and job benefits and promotion opportunity are great. So what do you need to know? So what do you need to know?
-
Date-boosting Solr / Drupal search results
By replacing Drupal's core search with Solr, it's possible to gain very fine control of the results. Not only is Solr very flexble, but the apachesolr module is generous with its hooks. One potential use is boosting the score based on dates, so that recent documents receive a higher relevancy score. We've used this for the L.A. Philharmonic's ticket calendar to help patrons find upcoming events.
-
Drupal 7 Tutorial: Creating Custom Filters in Views
I love views. It makes my job easier, so I can focus on the more complex things, rather then having to hand-write queries, create forms for filtering data and it saves time debugging my typos. Every so often you will get a request that can't be accomplished out of the box.
-
Drupal From Scratch: New Site Checklist
Set the Admin theme Seven comes installed with Drupal 7 Rubrik is nice but has one bug that doesn’t show view replacement patterns Set the site email address to your preferred administration email admin/config/system/site-information
-
Avoid Potholes When Deploying Drupal Sites to Media Temple Virtual Private Servers
I recently had occasion to set up a new Drupal site on a dedicated virtual private server on Media Temple (dv 4.0). Everything was going swimmingly until I deployed the site and tried to reach it via the IP address.
-
Drupal 7 Deployment Checklist
This list makes sure that we covers our... Ahem, bases. This is an update to the blog post originally written by Dylan Tack, our Lead Drupal Engineer.
-
My First DrupalCon – Tips for n00bs
I know it’s hard to believe I’ve never been to a DrupalCon, but it’s true. I’ve wanted to attend others, honest, but the opportunities just weren’t available at the time.
-
Drupal UI: The Usability Challenge
Anyone who has delivered a Drupal site to a client knows that the user interface does not always receive a warm reception. As Drupal geeks we have grown accustomed to the admin interface and workflow of creating and managing content.
-
PNW Drupal Summit Session: Javascript Workshop
I need a session on how to choose which session to go to. So much great information and so little time.
-
PNW Drupal Summit Session: Checklists for Effective Project Management
This session led by Amy Scavarda discussed how to use simple checklists to manage complex projects and tasks. Read on for some key takeaways.
-
PNW Drupal Summit Session: Calendaring with Drupal
Things You Can ( or Can't ) Do With the Full Calendar Module
-
PNW Drupal Summit Session: How to Recruit & Retain Top Talent
This session led by Glenn Hilton of ImageX Media focused on recruiting and retaining talent (particularly developers) and building an outstanding team. Read on for some great takeaways from successful hiring processes.
-
PNW Drupal Summit Session: Getting Paid & Adding Value in Discovery
This session led by Sean Larkin and Andrea Burton of ThinkShout looked at how to avoid competing for RFPs by instead partnering with potential clients in a paid discovery phase to help them scope their exact needs and in turn have a leg up on the competition to win the project. Read on for some presentation highlights and takeaways.
-
PNW Drupal Summit Session: You've Launched - Now What?
This session led by Amye Scavarda, a project manager at Acquia, focused on how to switch gears after a project launch to support the project lifecycle and how to build support into projects. Read on for some of the key takeaways.
-
Estimating Drupal Projects
This session led by Alex Kroman of Opensourcery covered exactly what the straightforward title suggests: Estimating Drupal Projects. Read on for an example estimation process.
-
PNW Drupal Summit Session: Ask Better Questions to Create Loyal Clients
This session led by Lauren Bacon of Raised Eyebrow Web Studio covered how to ask the right questions to build stronger relationships with your clients. Read on for some key takeaways.
-
PNW Drupal Summit Session: Close More Deals
In this session, Anne Stefanyk from Drupal Connect went over effective strategies for finding new leads, pitching them, and successfully landing new clients. Read on for some key takeaways.
-
Pacific Northwest Drupal Summit This Weekend
Metal Toad is proud to be a Gold Level Sponsor of the Pacific Northwest Drupal Summit which starts tonight with the 24 hour hacker lounge opening at 5pm.
-
Why to Drop your Custom CMS for Drupal
A little background.
-
Ranking Drupal Modules on Drupal.org
One of the biggest dilemmas I faced as a new Drupal developer was figuring out which module was the best to use in any given situation. Only when I finally got around some other Drupal developers did I get a real sense of which were good and which weren’t as good.
-
How to talk to your customers about Drupal Security updates
With the recent release of versions 7.2 and 6.22, a significant Drupal security flaw in 6.x has been identified and fixed. While I feel strongly this is illustrates the value of Drupal and Open Source, it can be a significant challenge to talk to your customers about this. Here's the email that we drafted up and shared with our customers (please feel free to use it, rewrite and share if it proves useful)...
-
Drupal 7 Tutorial: Creating Custom Formatters with the Field API
Custom formatters are a great way to control the output of your fields. In this tutorial I'm going to use an example that takes a user's Facebook URL as the input and outputs a button of the Admin's choosing, along with an option to open the link in a new window. To get started, we'll need to get a module skeleton sketched out. You'll need to create these two files...
-
Drupal Service Providers: Get your Drupal Marketplace on
I recently received an email regarding the launch of the Drupal Marketplace (thanks Megan!), where you get yourself listed if you're a Drupal service provider. Here's the email:
-
Where's the Love for Drupal Content Editors? (UPDATED)
One of the great things about Drupal from a developer perspective is access to a large, supportive community of other Drupal developers from which I learn every day.
-
Drupal 7 Tutorial: Creating Edit Content links in Views
Update: Use this module Old Method: Views can be very handy, but the views interface can be a little tricky. A question that comes up when training clients is "Why can't I edit this content?" when they are looking at a view. If you use the node row style, Views will add them for you but not if you use the fields style. You can surely explain how views work (results may vary depending on the client), but an even easier method is to create edit links that link directly to your content and use a little CSS/jQuery to make sure it's shown when and where it's needed. Using this method creates a handy little gear button when you roll over the content, with a link that says "Edit Content" when you click on it.
-
6 ways to make Drupal easier for non-technical admins
Over the years, I've created a list of ways to make Drupal easier for one of my target audiences: the non-technical admins and editors that run the day-to-day operations of a website. My list is getting huge, but the following six ideas are always reliable.
-
Views 3 makes programmers happy
Views 3 addresses some of the most stubborn parts of Views 2, and significantly improves the way Drupal programmers deliver features to clients.
-
Websites Don't Use Carburetors Anymore
It used to be that cars were simple. If your car broke down, a guy could pop the hood, check a few wires, hit things with a hammer and actually get things to go again. Modern car engines have come a long way, and now are a complex system of 500+ components. Gone are the days of carburetors.
-
Using Apache as a reverse‑proxy
Apache includes the ability to function as a reverse proxy, which means it can be directed to delegate certain requests to another server. I've found two useful applications for mod_proxy recently: mirroring static files from production, and accessing JSON data.
-
How to make a range selector filter in Views
Messing with your exposed filters for fun and profit.
-
Top 5 Reasons to Choose Drupal as your CMS.
We get a lot of questions about what makes Drupal a good decision as a content management system. Here are the top 5 reasons, in order of importance:
-
Drupal 7: Taking control of CSS and JS aggregation
Drupal 7 includes a big re-factor of the way CSS and Javascript are aggregated. What does this mean for your sites? In short: You will see a greater number of files compared to D6 - this is normal and not usually cause for alarm. Surprisingly, more files is sometimes better. To ensure efficient aggregation, the most important thing developers can do is choose the parameters to drupal_add_css and drupal_add_js carefully. And if you encounter contrib modules that are using the wrong parameters, please file patches! This was a somewhat controversial change, and understanding the new strategy (and how to override it) requires going a bit deeper.
-
Tracking Drupal's Fivestar with Google Analytics
Google Analytics can track more than just page views! Here's a simple Drupal module that records an event when a visitor rates content with Fivestar.
-
Drupal7 Spirit
Let it not be said that vosechu (Chuck Vose) has shied away from getting into the spirit of things. Drupal has hit version 7 as of this past Wednesday (1/5/11) and as our unofficial Chief Fun Officer, Chuck leads the pack on celebrating this big milestone.
-
Bartiki: a Drupal cocktail
To celebrate the release of Drupal 7, we created a new cocktail named in honor of our new core theme (and of course Ms. Bartik).
-
How to Add Theme Settings for Drupal 7
You know that list of checkboxes on the theme settings page that let you turn on and off parts of the theme like the logo or slogan? Well, you can add your own options to that list really easily in Drupal 7.
-
Deadline for Google Code-In quickly approaching!
Quick summary for those out of the loop about GCI: We define bite-sized programming tasks, Google comes in and finds people who want to do them, we mentor them and get new participating members in the community. Friday is the first deadline for GCI, it is the day where we decide as a community whether there is enough interest to continue. Right now we are seriously lacking. If you're interested in getting some more people to help out with D8, if you're feeling a little burned out please take 10 minutes and write up an idea or just comment on someone else's idea and offer to help mentor. 10 minutes and D8 will have a whole new crop of skills friends to help out. Webchick's post about GCI: http://groups.drupal.org/node/101019 Place to propose tasks or get involved: http://drupal.org/project/issues/gci
-
Stop! You are doing mobile wrong!
For as long as mobile sites have been around the conventional wisdom has been: build your website first and then create a mobile site as an add-on; creating a distilled, streamlined version of the desktop site. This makes sense, no? A few weeks ago I discovered that we've been doing it wrong*. Here's why:
-
Faster 404s with Drupal and ImageCache
Drupal generates nicely styled 404 pages that are easy to customize. And since 404 responses can be served from the page cache, the performance hit from the occasional stray image can be minimal. However, if you're embedding 3rd-party content (such as ads or social widgets), there is an additional risk that a misbehaving app can generate bogus requests with random-ish query strings. The unpredictable URLs will totally defeat the page cache, so on a really busy site the added load can be crushing.
-
Top 5 reasons why web designers should love Drupal
If you are a web designer and you haven't worked with Drupal before, you should really give it a try. Here are the top 5 reasons why...
-
URL Shorteners Must Die
URL shorteners (such as bit.ly and tinyurl) have been called the "herpes of the web". Beyond just link-rot, a public shortening service is per se an open redirect vulnerability. Their ubiquity makes them an easy vector for spammers, phishers, and cross-site forgery attacks. Joshua Schachter writes: With a shortening service, you're adding something that acts like a third DNS resolver, except one that is assembled out of unvetted PHP and MySQL, without the benevolent oversight of luminaries like Dan Kaminsky and St. Postel. Luckily, you don't have to contribute to this scourge.
-
Using JSONP Safely
JSONP is a way to make cross-domain requests through javascript. It takes advantage of a loophole in the browser's same-origin policy: <script src="https://anywhere.com/data.jsonp"></script> tags are allowed to load files from any domain. This differs from normal AJAX requests, which are only allowed to make requests to the same domain as the page you are viewing. Unfortunately, many guides to implementing this technique in PHP contain a dangerous security flaw. Can you spot it?
-
The Framework is dead. Long live the CMS.
If you don't know already, the framework is dead. That is to say, unless you have money to burn, frameworks like Zend, CakePHP, Django, Struts, .NET, and even Rails should not be considered as a foundation for building anything but the most unique and game changing websites*.
-
Playing Drupal the card game the Drupal way
Now that NodeOne is running out of Drupal the Card Game I feel like it's time to introduce my version of the game rules which I believe are actually significantly more Drupaly than the main rules.
-
Mechanizing Git bisect: Bug hunting for the lazy
Like this article? Check out our top 5 Git tips and tricks Git bisect is a powerful automated tool for searching deep into a project's history. Instead of searching for relevant commit messages (git log) or patches (git log -S), bisect actually allows you to run a functional test on each revision until the first bad commit is identified. (Okay, it doesn't test every revision, it performs a binary search, which results in at most log2(N) tests. This allows a relatively large history to be searched quickly.) The test can be done interactively, with the human performing each check, or mechanically if you can supply a testing script. Randy Fay has done a nice screencast on the interactive method; this post will instead focus on mechanizing the process. For an example, let's look at a core Drupal bug that impacts this very site: #812990: Search page title changes to Home. For the moment, we'll pretend the cause of this bug isn't already known, and hunt it with git-bisect.
-
Running Drupal Secure Pages behind a proxy
If you plan to use the securepages module behind a proxy that terminates SSL, there are some additional server configuration steps you need to take. In order to detect what the protocol is in use, securepages tests the value of...
-
How to Decide Between WordPress & Drupal
WordPress is great - and so is Drupal. They are different platforms and should be selected for different projects depending on the needs. So how do you make the choice? Here are a few questions you should ask yourself:
-
What's in a framework, experiences from Rails and Drupal
I've now been working professionally in Drupal for a year and have learned a lot about it; I have some patches into contrib but I've not really done much with core other than some simpletests I was too shy to commit at Drupalcon and some comments trying to help people out on d.o.
-
Semantic Views is Awesome
Like any Drupal themer, I've done my share of grumbling about the frequently ridiculous level of nested divs with dozens of classes.
-
How To Write Multibyte Safe Code With Drupal
Having spent the last 5 months supporting on a multi-language multi-site project, I've learned quite a bit about multibyte safe code, so I thought I'd share some key highlights.
-
A JMeter test plan for Drupal
Last week, I wrote about graphing JMeter results with Matplotlib. Let's take a closer look at the actual Drupal test plan. This plan was adapted from Jacob Singh's test and has five different thread groups: Anonymous browsing, Authenticated browsing, Editing a node, Search, and Login and view user page. The revised test plan is available for download.
-
Nesting Views like a Mecha-Eagle
As you have probably figured out, I love views. I love teasing out little features that are completely buried and obscure.
-
How to improve the default user list using Views in Drupal7
Taking the time to make the Drupal admin friendlier is rarely on the top list of priorities for clients. That said, as service providers we know the long term grief ignoring the admin can cause for administrators.
-
Plotting your load test with JMeter
Learn how to use the JMeter load testing tool. It comes with a built-in graph listener, which allows you to watch JMeter do, well... something. While this gives a basic view of response time and throughput, it doesn't show failures, nor how the server responds as load increases. And let's face it, it's just plain ugly. Enter Matplotlib, a beautiful (though complex) plotting tool written in Python.
-
How We Upgraded Metal Toad to HTML5 and Drupal 7
Our new site design is live, so if you're reading this in a feed reader, please click on through! In a nutshell, we wanted to redesign to take advantage of Drupal 7, HTML5, and dramatically improve the readability and usability of the site as a whole.
-
Getting Content Administrators to Crush on Drupal
We're just getting back from a great weekend at DrupalCampLA. A lot of topics were raised there but the message that really came home for me was this: as Drupal service providers we have to get CMS administrators to fall in love with Drupal.
-
Do your clients send you presents? If not, maybe we can figure it out together, lets talk about D7UX.
Do your clients love you with such a furious passion that it borders on problematic? Do you find new customers calling you and saying things like, "I must have your services! My friend has been bugging me all week to call you. Seriously, I just want him to stop camping out on my lawn. It's scaring the children."
-
A Git + Drupal Primer
Now that the Drupal community's migration to Git is in full swing, it's a great time to switch your own projects as well. Curious? Perhaps you saw the Git panel in San Francisco, or maybe you've listened to Sam Boyer campaigning passionately at your local DrupalCamp. Is there a rebel in your office who keeps going on about how much better life can be with git-svn? (How ironic that Subversion is now the establishment.) If you're just getting started, here are some tips I've collected over the last year. Or if you're already a Git ninja, here's how you can help.
-
Stop talking about scaling, make Drupal easier to use
It seems that I hear a lot of people within the Drupal community focusing on how to make Drupal scalable.
-
Drupal snippets #1 (Views exposed filters, F5 tweaks)
While I'm certain that I could never work up to the standards of Peter Cooper his "Interesting Ruby Tidbits That Don't Need Separate Posts" series was a great help to me when I was a ruby developer.
-
Grace Under Pressure: 2010 Emmy Nominations
I'd like to take a moment and recognize the accomplishments of my team.
-
First Thoughts of Drupal- Part 2
Continuing on with the previous topic of essentially “what is Drupal?” we move on to the discussion of PHP and its importance in being able to build or maintain a Drupal website. (btw I’m totally assuming that you know that PHP is a programming language)
-
Drupal Design Camp Boston Sponsorship
Metal Toad is now sponsoring Drupal Design Camp Boston. There are a number of reasons for this, but the foremost is that Drupal needs to build bridges within the design community.
-
With Drupal+Ubercart, be wary of alternative payment gateways
If you are using Ubercart to do ecommerce with Drupal, be sure to use one of the mainstream payment gatways: Authorize.net or Paypal.
-
First thoughts of Drupal
Like any good Gen-Y-er, knowing I would be starting a job at a web development company that specialized in Drupal technology, my first step was to Google “what is Drupal?”.
-
How to Select a Good Drupal Development Shop: Trust, UX & Security
If you are in the market for Drupal development, you may feel like you are trying to pick a car mechanic without knowing anything about cars. Like picking a mechanic, you often have to go on how you feel about the vendor. You should listen to what they say, and how they say it - carefully considering how that makes you feel.
-
Drupal benchmark results using AB and the simple things we did to get here
I was trolling around the Internet today looking for drupal hosting benchmarks and I actually had a little trouble finding something current. Dries has one comparing D6 on PHP4 vs D6 on PHP5 but that was clearly ages ago.
-
How to Change the Content-Type Meta Tag in Drupal
I'm working on an HTML5 theme for Drupal 7 right now, and I needed to change the meta content-type tag. By default it looks like this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />, and I needed the updated HTML5 version: <meta charset="utf-8" />. Normally, you can replace these things in one of the theme template files, but in this case, the meta tag was hard-coded in the Drupal source code somewhere, so I needed a programmatic solution. Here's what I found for both Drupal 6 and 7.
-
Using git-svn to manage standard and non-standard branches
When Webchick announced that Drupal was moving to Git at Drupalcon, our office erupted in pleasure at the news. Lots of great Drupalists are already using Git and there's even an unofficial ...
-
Drupalcon '10 Party Schedule
Every conference is better with events, but finding them can be such a pain when you're trying to absorb all the info in the seminars. So this year I'm setting up a calendar and I'm hoping people will help create it.
-
Revenge of the node comments: a pure jQuery comment pager
A previous post described how to reposition node comments with Drupal's hook_menu_alter(), to facilitate a tabbed interface. One side effect that popped up was pagers – when a pager link was clicked, the tab state got reset. The solution was to refresh the #comments div with AJAX. As an interesting twist, it uses the ability of jQuery's $() to construct a new DOM object from HTML. This means that no new menu callback is needed in Drupal; it fetches the comments directly from the href in the pager link. While a little inefficient, this technique has the cool benefit of being able to grab any content from anywhere on your site, with merely a URL and a selector. It also degrades gracefully for non-javascript users; since without JS the tabs appear as sequential blocks the pager will function normally. (The following code is based on the AJAX Comments project).
-
Dylan Wilder-Tack, Drupal Security Team Member
When discussing the benefits of open-source frameworks (especially Drupal), I've often heard, "But if everyone has access to the source code, how secure can it possibly be?" My standard response would be to discuss the platforms maturity and how it's been hardened by years of real world use.
-
A tiny cart block for Ubercart
Here's a tiny shopping cart block for Ubercart that fits right in with the menu. Of course the standard block could be themed this way, but this is handy when the design calls for the full-sized block elsewhere in the layout.
-
Drupal Theming 101: Theme Developer Module
If you haven't already heard of it, the Theme Developer is a great tool. It works like firebug, but for Drupal.
-
Drupal Theming 101: How to Remove System Stylesheets
When you first start creating a Drupal theme, you might be frustrated by the large number of stylesheets that are included by default in your theme -- especially if you're creating a Zen sub-theme.
-
Customizing views_cycle module for differently styled marquees
During the theming process for the Emmys, specifically Emmys.com and Emmys.tv, we were presented with 2 differently styled marquees. On Emmys.com, the pager uses an image, while on Emmys.tv, the pager uses number with a background image along with next/previous buttons.
-
Quick Drupal Cacherouter and Boost benchmarks
In the discussion following my last post about cron and the cache hit rate, I promised to do some testing of the different cacherouter ba
-
More complete breadcrumbs for Ubercart checkout
By default, Ubercart sets the breadcrumb on the checkout page to simply "Home", which I personally find a bit odd. Because it calls drupal_set_breadcrumb() late in the request cycle, it's not even possible to create menu links for use by the menu_breadcrumb or menutrails modules. Stranger still, the cart settings page offers a "Custom cart breadcrumb" text and URL option, but it's hard-coded to use a single link instead of a trail of links. Here is a small snippet that will set the breadcrumbs to mimic the URL paths, for example: Home › Cart › Checkout
-
How Drupal's cron is killing you in your sleep + a simple cache warmer
A lot of what's written about performance tuning for Drupal is focused on large sites, and benchmarking is often done by requesting the same page over and over in an attempt to maximize the number of requests per second (à la
-
Allowing CCK to handle the weight of your form elements
Lately I've been working on a project to allow drupal to intelligently manage legacy data, to display, edit, and work with all aspects of the data as securely as possible. Naturally, it's difficult to say the least but I've learned a great deal. One of the things I thought was going to be a pain but ended up easy was managing where the fields appeared on a form. Yes, I could set the weights manually through the Forms API but CCK actually gives us some really great tools to do this without sweating. For reference, this is based on the wonderful if totally impossible to find article here: The Great Pretender.
-
Repositioning node comments
A strange quirk in Drupal 6 hard-codes comment rendering into the node module. This makes it quite difficult to reposition comments, for instance under a set of tabs in the node template. Attempting this brings you crashing into the most dreaded rampart of Drupal theming; moving something out of it's vertical stack:comment_render($node) can easily be placed in your node template, but how on earth can the original display be removed? comment_render() is called by node_show(), which contains this nugget: if (function_exists('comment_render') && $node->comment) { $output .= comment_render($node, $cid); } Ouch. (Thankfully, this has been fixed in Drupal 7.) While it's tempting to fake it with jQuery, or CSS positioning, there is a way to fix this by overriding the page callback for node rendering. Here's a quick module that implements this solution:
-
Whitehouse.gov re-launches on Drupal
If you have ever spent any time around software development, (especially here in Portland with our amazing open-source community) you'll know that the community takes a great deal of interest in the success of others.
-
Deployment with Capistrano Part 2: Drush integration
In my last post, a basic intro to to running cap deploy was presented. Now, let's look at some more advanced scenarios. (See Part 1 for the actual task definitions described here). Multistage: Deploy to different environments (such as testing vs. production). Drush Integration: Use the power of Drush to extend Cap's reach into Drupal's internals. Multisite: Run many sites from a single code base.
-
Capistrano: Drupal deployments made easy, Part 1
I'm a big fan of having an automated deployment process. It's really the web development analog to the "one step build process", as described in the Joel Test. In the past I have used various shell scripts to perform this task, but I have recently become a convert to Capistrano (or "cap" for short). With Capistrano, uploading your code to the test server is as simple as typing cap deploy. When you're ready to launch in production, it's just cap production deploy. From capify.org: Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back changes across multiple machines. In detail, here are the features that got me hooked. There's a lot more that cap can do, and I'll describe some more tricks in part 2 of this post. Atomic deployments with error checking. Cap uses a set of symlinked directories, and the links are updated during the final step. It also won't allow a deployment to keep plowing ahead if an intermediate step fails. This makes your deployment atomic; it will either fail or succeed entirely. Fast rollback. If something does go wrong, getting back to the previous state is as simple as cap deploy:rollback. Parallel execution. If you use multiple servers in a load-balanced environment, cap can make managing them easier. Multistage deployments. "Stages" are different server instances of your code. You may have different servers for development, content entry, and production. With the Multistage extension, cap can share code for common tasks between these stages.
-
SimpleTest 6.x gets e-mail capture!
The latest 6.x-2.9 release of SimpleTest includes a backport of the e-mail capture feature from D7. This means you can finally unit test e-mail sending functionality! There is still one bug to be ironed out, but a patch is available.
-
iPhone video streaming from Drupal's file system
It's well known the iPhone can play H.264 video. With tools like ffmpeg, hooking this up to Drupal ought to be simple, right? Here are a few snags I hit, and how to resolve them.
-
Bulk generating menu hierarchies
If you have ever needed to bulk generate menu items in Drupal (I used this for theming some drop-downs), here is a snippet to accomplish it. The third parameter is for recursively creating a hierarchy, so be careful with it – you can blow up the menu admin page in a hurry! This code requires the devel module; the ambitious reader might consider adapting this to patch devel itself.
-
An unexpected occurence with Git, how it made our life easier this time
In my experiences in the past working with external contractors is often a pain, especially the final merge where you try to incorporate all their code. I've always been a huge proponent of Subversion for SCM but today I saw an example where Git knocked the socks off of Subversion.
-
Fun with stakeout.rb
Having only left Rubyville a couple weeks ago there are still a lot of Ruby-based utilities that I still find incredibly handy. One such utility that I've recently fallen hopelessly in love with is stakeout.rb from: http://pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutF…
-
Converting from Brightcove 2 and loading arbitrary videos
Over the last two weeks I've been working on a project to convert one of our client's websites to Brightcove 3 players. As I am quite new to drupal but not to PHP you can imagine that many of the problems I had were unrelated to brightcove itself but there were a few aspects that I thought were worth documenting for those who are in the (surprisingly) enviable position of doing this migration.
-
Stage-specific Drupal settings with local_settings.php
The decision to store settings.php in your version control system can be sticky. On one hand, there may be application-specific settings you would like to manage (perhaps the session lifetime, for example).
-
Drupal Deployment Checklist
Here is a short list of things I check before finishing a new deployment. Database logging row limit (admin/settings/logging/dblog)
-
Trouble with Drupal, MySQL and non UTF-8 formats
I just figured out a fix for an annoyingly circuitous, tortuous, and baffling MySQL problem. I am not yet an expert of back-end system configuration, but I can tool around a bit (i.e. I know where the my.cnf, php.ini, etc. files live and when (mostly) to edit them). With that...
-
Drupal 6 Theme Test-driver
Reading through the Weekly Drupal feed, I found a linked site that is pretty rad. Being primarily a developer, I am always interested in exploring the way the designer's side of Drupal. Besides helping me understand Drupal more fully and write more easily extensible code, its fun/cool to make sites look fun/cool.
-
A Drupal version of chicken vs. egg: external API content fetching and cron failures
Recently we had an interesting issue with one of our multi-site Drupal hosting deployments; the cron was not running regularly. Sifting through the logs showed that the cron seemed to be running extraordinarily long.
-
Drupal/AJAX: Exercise caution when using special foreign characters
I was recently working on a Brazilian Drupal 6.x site that uses CCK forms and needed some functionality to map a dropdown select list of states to another dropdown of cities in the chosen state, which I accomplished using a combination of the
-
Drupal 'Access Denied' on all pages
Ran into an interesting little snag this morning - a client's Drupal site was spitting out "Access Denied" errors for all page loads by anonymous users. It didn't appear to be a permissions problem - the nodes just wouldn't let anyone look at them.
-
Automated CVS checkouts of Drupal Core + Contrib
If you've built out more than a few Drupal projects, you've probably gone through the same song & dance a number of times - find the most recent release of core, download, find the most recent release of Views, download, find the most recent release of CCK...
-
Using PHP/MySQL w/Drupal to update missing Google Geocode data
We recently needed to fill missing geocode values in a project's database. Using some PHP magic and taking advantage of hook_cron() this is how we filled the missing values: /** * Implementation of hook_cron() * When the cron runs, try to resolve any locations that have a lat or lon = 0 */ function overmap_cron() {
-
Autocomplete, clearing form values and Drupal form fields
Some browsers like to be helpful and help by remembering certain form fields. I was having a problem with Firefox auto-populating my some of my form fields (specifically field type 'password' and 'password_confirm') in a custom module I wrote.
-
Validating multiple drupal form fields and only outputting one erro
I've run into this problem twice. So it was time to figure out a solution... Check out my solution on the drupal support boards @ http://drupal.org/node/155695#comment-1263443
-
How to Add a Field to the Drupal Contact form
Ever wish you could use the existing Drupal Contact module as your sitewide contact form and just add a field or two? You can and it's really easy. All you need to do is create a new module and add the fields via the hook_form_alter() function.
-
Adding a directory to subversion, and ignoring the directory contents
Sometimes when committing things to svn you want to commit a directory, but ignore all of the files inside it. Here's how.
-
Ubercart Checkout + IE7 + Google Toolbar Autofill = broken
Working on an Ubercart site recently, I ran into a small snag : some of the collapsible fieldsets weren't opening under IE7 when using the Google Toolbar w/ AutoFill enabled.
-
Top 12 Drupal Modules
I just got back from Webvisions here in Portland. There were a number of interesting presentations and conferences are always good to get revitalized. One presentation that was of particular interest to me was by Sean Larkin of OpenSourcery, where he covered Drupal as a development platform.