October 07, 2016
The ABC's of Drupal: Article, Base Theme, Content
For anyone who's ever looked up a definition of a Drupal term and been left wondering what it all means, here are some practical real world explanations you can use to navigate the Drupalverse. Watch this space and use comments to send us your feedback and requests.
Article: While newspapers and magazines have articles, the term 'Article' in Drupal denotes something more specific. An Article is one of two content types that have come preconfigured with Drupal since Drupal 7. As a content type, an Article is made up of Title, Body, Image, and Tag fields.
All content types are part of Drupal’s core fields system and can be customized with different fields. The output of an Article is usually configured to appear either as a teaser or a full version, which is sometimes referred to as the default or as a node. Unless your home page has been customized, article teasers will appear on your home page as a river of news with older items sinking to the bottom. This makes it easy to begin building a site with time sensitive content such as a blog. Most home pages are even customized so that selecting the ‘promote to front page’ toggle has no visible effect. If this happens to you, don't worry! Your site is not broken. It's just Articles at work.
Among the advantages of using a base theme are less risk from custom coding and updates often provided by base theme maintainers that enable greater functionality or enhanced security. Some base themes make it easier to build a theme based on a popular published library, such as Twitter Bootstrap. Organizations often develop their own themes and use them internally as a base theme for different projects.
As a note: base themes typically only work with a given Drupal major version. For example, Drupal 7 theme will not work with a Drupal 6 or 8 theme. Major changes have taken place in theme development between Drupal 7 and the current version Drupal 8. But don't worry! Drupal 8 includes a new templating engine called Twig. Twig is a Symfony framework component that eliminates the necessity to write preprocess functions and other code. Generally, that's often not part of a front-end developers skill set, so Twig makes it easier than ever for front-end developers to create responsive and other advanced designs.
Content: The word "Content" can mean different things to different people, especially when Drupal is involved. When speaking to a Drupalist who’s been around for many versions, it may mean only something created by Drupal’s core node module or anything that has been created via a content type form by clicking on an ‘add content’ link. Others will use it to represent anything presented on a webpage.
Depending on who you are talking to and what their role is, this can lead to confusing discussions or debates about whether something is Content or something else. The best way to deal with this on a project is to understand the other definitions and always ask the speaker to please define what Content means to them.
For example, Content can be structured or unstructured. (The preferred best practice in Drupal is always structured content validated at the field level.) Comments, images, and file attachments may also be considered Content. Images and file attachments are often referred to as assets because they are stored in a file system. In Drupal 8 you are more likely to hear this kind of Content referred to as an Entity, which thankfully simplifies the conversation.