Taming Content the Drupal Way
The web has come a long way since the days when editing website content required knowing HTML and how to use a FTP client. While creating websites has grown in complexity, there are now many platforms, both open source and proprietary, that let people easily publish content on the web without web development skills. The popularity of platforms like Facebook, Tumblr and Wordpress has resulted in many more people publishing content on the web.
Now most people expect easy ways to put forth content. In other words, "Don't make me look at code." And they want it to look good. The challenge then is how to take potentially messy content from people with varying skill levels and translate it into valid markup that is consistently formatted and in line with an existing style guide. Drupal does a great job providing the building blocks to solve this problem. In case you're new to Drupal, it's an open-source framework that can be used to build different types of web applications, Content Management Systems, blogs, intranets and mobile apps, among other things. The core package is free to download, and easy to extend with contributed modules from Drupal.org. If Drupal core doesn’t provide the functionality you need, there's most likely already a contributed module for it.
The FB Share Form
Websites like Facebook, Wordpress, Tumblr and others are setting the standard for easy content entry. Let’s step back and take a look at the “Share” form on Facebook:This form is a very advanced example. It is both deceptively simple and easy to use. How do they do it? For each of these content types — Post, Photo, Link and Video — there are multiple forms. Only the one selected is shown.
- It provides different fields for entering different types of data and media depending on which is selected
- It does not allow options for formatting HTML using an WYSIWYG editor or toolbar. Just enter text, a link, or upload something.
- The Post type automatically recognizes links and switches to the Link form
- The Link form automatically detects any image and adds a small thumbnail preview. It also grabs teaser text from the target URL. Before you publish, it also allows you to edit the title and teaser text.
The Link form automatically fills in quite a few fields for you once you past in a URL. The fields present are the title, URL, thumbnail, teaser text and comment. That’s five fields, but we’re only required to fill in one field, the URL, and optionally add a comment. Pretty sweet, huh?
However, while Facebook allows easy content publishing, it serves only a specific purpose and lacks flexibility and the ability to customize its functionality.
Pick Your Poison with Tumblr
Tumblr also provides different types of content. While Facebook automatically chooses the content type and populates fields for you, Tumblr requires you to manually select the content type.
Content entry using the Quote content type:
Though this interface may not be as streamlined as Facebook's, it still receives content in a pretty straightforward way that adheres to consistent formatting and content styling. Two things worth pointing out:
- The Quote field prevents HTML tags and the Source field limits the HTML that can be entered to bold, italic, strikethrough and linked.
- It separates the data into two different fields, Quote and Source, making it easier to funnel this data when displaying on the front-end.
The experience of Tumblr is more comparable to the way Drupal lets you structure forms.
The Drupal Way
While these sites have the workflow down to a easy-to-use science and empower us to share massive amounts of stuff on the web, they cannot be customized. Additionally, if Facebook or Tumblr disappear tomorrow, your content might be gone too. Drupal gives more people contol over their content.
Structuring Data
The greatest source of Drupal’s power stems from its ability to provide very flexible ways to structure and retrieve data. It does this by letting you create your own Content Types (e.g. News item, Blog post, Quote) and add various Fields (e.g. Textfield, Image, Numer, File Upload). This affords a high level of control over data input and sorting. This ability to add fields is a feature unique to Drupal amongst all other Content Management Systems.
Here’s a form for entering a Partner Organization content type using Drupal:
After installing Drupal core and adding a handful of modules (namely, Views, CCK, Link, FileField and ImageField) this form took me less than five minutes to build and required no custom code. I can reorder, hide and show these fields through Settings. If I want to tweak the form further, there are well documented ways to modify the style and layout of the form. This functionality makes it possible to create many different types of websites, structured exactly as you please. This proves vital in cases where you need to own your own content or want a site that's different from existing solutions. Let's say I wanted something similar to Tumblr, with the addition of a Resource or Document type; I likely wouldn't be able to talk Tumblr into making this sort of change!
Inputting Content
Controlling content presentation starts with content entry: building a system that handles content entry well. One piece of this is creating forms that structure data appropriately. The other piece is filtering content that gets entered into text ares (multi-line text boxes). Drupal can be customized to filter HTML and input in many different ways. Some commonly followed best practices for text areas include
- Preventing access to full HTML entry
- Automatically adding paragraphs and line breaks
- Allowing a limited set of HTML tags (ul, ol, li, h2, h3, h4, em, strong, a, img)
- Or stripping out all HTML tags
Presenting Content
I've talked a lot so far about inputting content, but what do you do once you have all that content in your site? That is almost another topic entirely, but most websites will need ways to find and browse through content. Drupal provides many options for how to build out your site to present content, from adding menu items to creating sortable, searchable lists of content, all without having to write much or any code. With some expertise, content can be fairly easily displayed in nearly any way you can imagine and styled exactly the way you want. Having a Drupal expert will help find the best ways to leverage Drupal to efficiently meet your needs. Not everyone will have the budget to build a site as polished as Facebook, but Drupal makes it possible for a lot more people to have full control over their content.