Last time I blabbed about Drupal modules, I talked about how you better download and install Pathauto if you want to hang with the cool kids. If you were paying attention, you noticed that I also promised/threatened to talk about a few other modules we don't think a proper Drupal site can go without. Prepare yourself for...
CCK
The Drupal Content Construction Kit (CCK) module is an absolute must-have. Like the name implies, the module allows you to create your own brand spankin' new content types in Drupal, allowing you to further customize you Drupalin' experience.
Probably doesn't make much sense if you aren't a Drupal person and already familiar with the Drupal vocab, but it's pretty simple. In Drupal, "content" essentially refers to the various articles, etc. you see around a site. For example, the post you're reading right now is "content." A static page, like our Contact form is also "content."
In the basic Drupal install with no new modules added, you'll have a few different default content types. "Page" and "Story," for example. Those are pretty well covered already in the Drupal handbooks, but the jist is that a Page is a single, static HTML page, while a Story is generally like an article (has a title and a body).
But what if you want more from your content? Like you want to have additional fields that just aren't included in your normal Story? Well, then you need CCK.
In our case, we wanted to have a content type that had a second heading, not just the normal Title field. We also wanted to be able to include referenced websites in a handy list at the end of each post. Yeah, we could have just added those into the body of an existing story each time, but that would have meant styling them properly every time (or at least including them in a new DIV with a specific class).
But we're lazy, and we like to separate our content from our presentation as much as possible, so we installed CCK (and a couple additional field types), created a Nerdly Article content type, and voila! Reading this article, you see the results.
CCK does have a couple of little gotchas, though. For instance, you might need to modify your theme a little to get the output the way you want. In our case, that meant modifying our node-article.tpl.php file to only show the heading for the References section of a particular article if that article included references. Otherwise, when we used the plain ol' <?php print $content; ?> tag, that heading would appear regardless. Looks bad to see a heading when there's nothing under it, eh?
I briefly mentioned above that we installed some additional field types... For instance, this main content area is a Text field, one of those included with the core CCK module. The links in the references section, however, are created using the Link field type. That one we had to download and install separately. When we add content, we see fields that allow us to just enter the title for the link and the URL:
Now when you view this, you'll see those links at the bottom. What's more, someone like me (who has the design skills of a paraplegic ape) doesn't have to worry about making them pretty. Instead, Jeremy can raise up and get his CSS on, making the rest of us look good.
Other cool thing about CCK is that the newest version is totally compatible with another necessary Drupal module, Views. With just those two modules, you can do some pretty extensive customization without know a lick of PHP.
So what about you? You use CCK? Which additional fields do you like?






Recent comments
2 days 6 hours ago
5 days 16 hours ago
6 days 20 hours ago
2 weeks 4 days ago
3 weeks 20 hours ago
5 weeks 7 hours ago
5 weeks 1 day ago
6 weeks 2 days ago
7 weeks 3 days ago
7 weeks 4 days ago