It's not easy being popular. You live under the specter of something new breathing down your neck, waiting to take your spot in the limelight. Yes, we know all about it.
But seriously, in the content management world uncool means stale, broken, or worse, irrelevant. Fortunately for Drupal (news, site), the much discussed version 7 release is looking strong. It'll keep its cool we reckon and in the process it's shaping up to further enter the mainstream. Here are the key changes to note.
Drupal 7 Brings Tons of Changes
To say there's tons of little improvements -- a bit of something for everyone -- is an understatement, there are far more than can be detailed in this article. For site builders, the big changes begin with dependencies. Drupal 7 requires PHP 5.2 and either MySQL 5.0 or PostgreSQL 8.3. For databases, you now also have the option of SQLite.
According to Angie "webchick" Byron (the Drupal 7 project co-maintainer), part of the goal with this release is to finally bring Drupal core into line with contrib. In that way, core is freed from constantly running and trying to play catch-up, and module maintainers can stop having to invent their own wheels.
Efforts were also made to fix "a bunch of stupid crap" that had just never been fixed in core due to other priorities. There are many more little (yet important) things that may thrill Drupal users. But here, we're going to focus on the big things. The game-changers.
So, read on.
Fields in Drupal Core
As someone overflowing with data-driven site ideas, one of my personal favorites is the move of CCK-style fields into Drupal 7 core. Notice the deliberate wording here. CCK itself isn't being moved into core. Instead, many of its better and, well, "core" features are being moved into core, including a close equivalent to CCK's UI.
Essentially Drupal is moving from a focus on nodes, to a focus on fields. The new fields portion of core -- appropriately named the Field module -- includes a new Fields API and a massive change in architecture.
Fields in Drupal 7 can be attached to nearly anything (but sadly, not user profiles). With Drupal 7 core, they can be attached to:
- Nodes, like blog posts, articles, and pages
- Taxonomy terms
- And more
Not just that, but many elements that were once parts of nodes are now fields, such as a node's body section and taxonomy vocabularies.
The conversion to fields has also allowed advancements such as moving both the Image Field's and File Field's module functionality into core. Now you can create a field type of Image and you will have the power of sophisticated image handling as part of the native tools.
But don't think that all field goodness has been moved into core. Not even all of CCK has. The Drupal 7 version of CCK is stripped down to the pieces that didn't make it in, such as the node reference and user reference fields. Some people will still need CCK to make their content type dreams come true.
[Editor's Note: Check out our 2009 Open Source CMS Market Share report for details on the 20 most popular open source content management systems.]
D7UX, the Reworked User Interface
In a bid to reduce the Drupal learning curve for site owners, a major aim of Drupal 7 has revolved around D7UX, or the Drupal 7 User Experience project. This massive undertaking involved Acquia (news, site) bringing on the same design firm that handle the Drupal.org redesign, Mark Boulton Design Ltd., in order to drive and manage the interface overhaul in an open way that involved the Drupal community.
Working closely with the Drupal Usability group, Boulton used a combination of their own experience, community input, usability testing from the Universities of Baltimore and Minnesota, to work toward a collection of changes that are too far-ranging to list out completely.
Some of the more notable improvements are:
- A clearer separation of administrator versus user tasks
- An improved help system
- Improved support for WYSIWYG editors
- More drag-and-drop capability
- An improved permissions management interface
- Two installation profiles, Drupal the framework versus Drupal the CMS
- A more helpful password strength checker
- Reworked and simplified configuration pages
- Vertical tabs on content creation pages and editing forms
- Navigation improved so that links in the admin panel let you drill down to tasks more sensibly
Changes for Themes
Drupal 7 brings many changes to themes. These changes fall under the category of additional features rather than a fundamental overhaul.
For one thing, you can theme in Drupal 7 using just CSS, with "sensible" CSS IDs and classes defined by default. Themers will also have more granular control over $content.
When it comes to default themes, it's goodbye to Chamelon, Marvin, Pushbutton and Bluemarine, all of which were cutting edge when they were introduced but had become a bad first impression for new Drupal users thanks to their dated appearance. A new theme (or non-theme) was also introduced, called Stark.
Stark is essentially Drupal's raw output with just enough CSS for layout purposes. The purpose of this theme, according to Byron, is to give theme developers a nice starting point for their work. Also, many elements of the popular Zen theme were moved into core.
Admins also got a new administrative theme for Drupal 7. Hooks such as page_alter, form_alter, and menu_alter let themes access alter hooks and reorder fields on forms, change buttons, etc. rather than having to change a module.
Additionally, you can now pre-process theme functions instead of just theme template files. This capability adds further ability to streamline your themes.
A Next Generation Database
On the database front, Byron says that "everything that ever sucked about [it] is fixed now."
Drupal 7 offers a rewritten, object-oriented database API based on PHP Data Objects, or PDO. Nicknamed Database: The Next Generation (DBTNG), this layer allows Drupal to support any database that PHP supports. Side effects include:
- The ability to support multiple database types at once
- Improved database portability
- Database-specific optimizations
- Transaction support
- Master/slave replication
- Drupal finally supports SQLite
- Database query logging with richer meta-data
Extensible File Handling
In Drupal 7, the whole file handling system was overhauled. Files are now first class Drupal entities. Functions have been added for managing the file lifecycle above and beyond the simple PHP-provided file-handling code, with each function having a hook that can mediate access to the files. Hooks essentially enable modules to be notified when something changes and then respond accordingly.
Another important improvement to file handling is the addition of PHP Stream Wrappers, an abstraction layer which lets Drupal access virtual or remote filesystems as though they were local. Using structures such as public://, private://, temporary://, flickr://, and s3:// you can now include remote content whenever you need to. Any module can create a new type of URI.
Better yet, you can finally use the public and private file systems at the same time!
Native Image Handling
When it comes to image files, Image Cache and Image API have both been moved into core. As I mentioned before, images are no longer nodes, they're fields, allowing you to create a single node with multiple image fields attached. For those who prefer each image to be a node, they still have the option of creating a content type with a single image field attached.
Upload module has also been moved into core. When you upload each image, Drupal 7 automatically creates a thumbnail and medium version of the image to go along with the original (large). You can also create more presets with image style, making them context-dependent, and do dynamic image manipulation from within Drupal.
Integrated Module Test Framework
In 2008, Drupal head Dries Buytaert declared that it was time for the Drupal project to embrace test-driven development. Shortly thereafter, the continuous testing infrastructure was added to Drupal 7 core, with automated testing constantly checking to see if anything's broken with the latest code check-ins. The lofty goal is to get all of core covered by the automated testing, so that it becomes immediately obvious if something gets broken.
The test framework is based off of SimpleTest and handles both unit and function testing. As of June, Buytaert states that "the automated tests allow us to focus on the architectural and the algorithmic changes introduced by a patch, rather than having to worry about unexpected side-effects," improving the speed at which they can work.
Rather than dealing with the unspoken computing rule that fixing one thing breaks three, each patch comes with tests that verify the bug is fixed, and the tester continuously checks to make sure that bug has not returned.
Other Items of Interest
Semantic Web Support
Bye Bye Ping and Throttle
Mind you, a number of features have also been removed from core. For example, the throttle module, ping module, and Blog API are now no longer part of core. The throttle module was always a bit iffy, the ping module isn't really necessary these days with the big search engines like Google tracking content changes, and the Blog API was only used by about 2% of users and so didn't really need to be in core. In fact, it's speculated that Blog API might benefit from being in contrib because it can advance faster than if it's in core.
Performance a Work in Progress
Performance-wise, because so much has been added to core, Drupal 7 was a bit slower than Drupal 6. While sometimes there must be tradeoffs for flexibility over performance, this issue wasn't really something to focus on until reaching the proper point in the development cycle. With so many freezes now in place the team can hunt and destroy bottlenecks wherever they find them.
Multi-culture Support Improved
I'll close with two small but pretty important changes that will make Drupal 7 a lot easier for many people. The first is that in addition to translatable fields, people also have the option of including context with a field so you know if a term refers to a noun, verb, or something else. And Drupal 7 finally has proper timezone support!
If reading all of this has inspired you to go check out Drupal 7, why not kick its tires (download the DEV builds here) and see if you can find or solve a few bugs or performance issues while you're at it? Or, just dream about what you might be able to do with this next Drupal incarnation when it's done.