Skip to: Site menu | Main content

Understanding the Drupal Way - Alters

In Drupal an alter is intended to provide a way to modify an object during a point in the execution of a certain event or process. Alters are defined within individual modules. Those modules then give the opportunity for other modules to "alter" an object by calling drupal_alter at the appropriate time.

Understanding the Drupal Way - Themeable Output

The whole point of creating a custom theme is to get a website to look the way you want it to. So, it's important for the output that modules generate to be themeable.

I will give a simple example of modifying the markup that is used to display some links. The Flag module provides a mechanism to do things such as "liking" a post or reporting a post as spam. A post may have a link for each flag that is associated with it.

Understanding the Drupal Way - Hooks

In Drupal a hook is intended to provide a way for actions to be triggered during a point in the execution of a certain event or process. Hooks are defined within individual modules. Those modules then give the opportunity for other modules to "hook into" their processing by calling the hook at the appropriate time.

Understanding the Drupal Way - Collaboration

Collaboration is an important part of the Drupal community. The principle of collaboration applies equally to how people in the community engage with each other and to how modules are written.

I mentioned the Libraries API in a spearate post when I discussed creating a slideshow. The specific example was that you would use the Libraries API and you would also use the jQuery cycle plugin as part of creating a slideshow.

Understanding the Drupal Way - Extensibility

When creating a module for Drupal it is important to write the module so that it is extensible by other modules. I will talk about ways that it is possible to do this in other posts.

I mentioned a couple of examples of extensibility in the Modularity post. In my example of adding a slideshow to a Drupal site I said that you would likely use Views, Views Slideshow, custom content types and custom fields.

Understanding the Drupal Way - Modularity

I mentioned in a previous post that Drupal is a modular framework. The idea is that modules should be designed to do one (small) thing well. This is in contrast to the monolithic approach that plugins employ in other content management systems.

For example, if you want to add a slideshow to a WordPress website you can download a single plugin from the WordPress official site. When I visited the WordPress site and searched on slideshow I got over 500 results!

Understanding the Drupal Way - Subthemes

In order to retain the changes you make to a theme like the Bartik theme you need to create a custom subtheme. Use the Bartik theme as a base theme.

It's beyond the scope of this post to go into detail about Drupal's theme layer and how to create custom subthemes and themes. So, I won't explain everything you have to do. You can find more information on Drupal.org.

Understanding the Drupal Way - Basic Drupal Principles

The first thing to understand about Drupal is that it is based on a modular approach to providing functionality. I will elaborate on this further in another post.

The point I want to focus on in this post is that every module on a Drupal site is a first-class citizen. There are no "special" modules that can so something that other modules cannot do.

Three basic types of modules are:

  1. core
  2. contrib
  3. custom

Build a Website That Works for You!

No matter what tool you use to create a website, you still need to put time into planning before you actually start designing and building the site. If you rush to start with the design and build process you run the risk of having a project that takes more time and money than desired and generates less of a return on investment. There are key questions you need to answer to ensure that you create a clear and comprehensive website definition document.

How Much Will it Cost to Build this Website?

As professionals in the web tech sector, we know that there is no one set answer to that question. And yet, we really don't want to be spending our time having to explain over and over to prospects why we can't just answer the question.

We could provide an analogy and respond by saying, "That's like asking a random custom home builder how much it's going to cost to build a house." We could continue by explaining that the builder will need to know the location of the house, the square footage of the house, the desired finishes on the house, etc.

Credits: XWeb | Chris Herberte | Andreas Viklund