20 APIs in 20 Days: The Forms API

Apr
08

This post is an entry in our 20 APIs in 20 Days series. Learn more about how best practices lead to sustainable development at www.trellon.com.

There's not much that has not been said about Drupal's Forms API, and it can be a challenging concept for developers who are used to working with other platforms. Any series talking about the underlying framework would be incomplete without some discussion of how it is used.

The Forms API in Drupal provides developers with a way to dynamically construct, modify and secure forms on your web sites. Instead of writing out the markup for individual form elements, developers define a form through an array that instructs Drupal on how to assemble the form and present it to users. The Forms API also tells Drupal how to validate form submissions and what to do with any data being received.

The real power of the API, however, lies in the fact that custom modules can modify forms as they are being generated. Developers can create new fields, provide additional validation conditions, and handle form submissions dynamically. This kind of extensibility is unique to Drupal, and represents a very different pattern for designing web applications. Read More >>>

20 APIs in 20 Days: View on Views API

Apr
05

This post is an entry in our 20 APIs in 20 Days series. Learn more about how best practices lead to sustainable development at www.trellon.com.

Views is the most widely used of all the contributed modules for Drupal. It offers the ability to easily create pages and blocks of dynamic content, which can be authored through a web based interface. It also allows site admins to attach filters to views, providing useful ways to drill down on data without too much effort.

The Views module also possesses a well defined API for working with views in code. Developers can call views within their modules, modify the way views are displayed, and even create new views programmatically. There is extensive documentation and community discussion about the different ways you can work with views in your code. This edition of the 20 APIs in 20 Days series seeks to provide an overview of some of the less well-known features of the API, that our team often finds useful when developing sites for clients. Read More >>>

20 APIs in 20 Days: The Hooks API and Custom Modules

Apr
01

This post is an entry in our 20 APIs in 20 Days series. Learn more about how best practices lead to sustainable development at www.trellon.com.

Ask someone what a 'hook' is, and their answer can tell you quite a lot about the person. The word gets used to describe things related to pirates, music, characters in campfire stories, aeronautics, etc. The word also has a specific meaning in programming, however, and serves as an important structural concept in most modern programming languages and frameworks.

Most Drupal developers are well acquainted with Drupal's hook system. Hooks are triggers that operate when certain events occur in the page generation process. They are capable of modifying data while it is being processed and carrying out other actions in response to certain conditions. Some of the more common hooks operate when a node loads, when a form is generated, or when someone saves user information. This part of the 20 APIs in 20 Days series provides an overview of the nature of hooks and how they operate as the foundation of most custom modules. Read More >>>

20 APIs in 20 Days: Using CCK to Create New Field Types

Mar
31

This post is an entry in our 20 APIs in 20 Days series. Learn more about how best practices lead to sustainable development at www.trellon.com.

CCK is the most important acronym you need to know in relation to content management in Drupal. It stands for Content Construction Kit and is the framework that allows people to enter all kinds of different information in their web sites. Read More >>>

20 APIs in 20 Days

Mar
29

So, you can put out a passable brochure site in a day and have reached the point where you want to learn a little more about Drupal. You're not looking to become an elite hacker type, you just want to be able to do something beyond pointing and clicking your way through site building.

But where to start? Between all the books, DVDs, blogs, forums, IRC channels, YouTube videos, meetups and self-proclaimed 'ninjas' spouting off and vying for your attention, figuring out where to spend your time and hard earned dollars can be a challenge. Different people have different ways of learning, and there are some people who are going to find all this stuff useful at some level.

But instead of going down the road of 'educational materials' written 'for the rest of us', you may want to use your time doing some self-directed learning about APIs (or Application Programming Interfaces). These are the tools people tend to use to solve problems in Drupal, and they can apply to a wide range of challenges developers are going to face. Even if you do not consider yourself to be a programmer, you may want to understand what they are all about. Knowing what they are and when to apply them is often the difference between a good Drupal site and a great one.

20 APIs in 20 Days is a blog series published by Trellon, aimed at sharing a little bit of information about module interfaces every good developer should know at least a little bit about. We don't intend to publish information in 20 sequential calendar days, but do plan on spending 20 days going over something important you may find useful to know. So don't give us a hard time when we forget to hit 'publish' a couple days in a row - it's going to happen, Trellonauts tend to be very busy people. Read More >>>