Drupal Content Creation Kit

Filed under: Uncategorized. Tags: , ,

Drupal 4.7 has an amazing “Content Creation Kit” module available for it (apparently, the module drove much of the node redevelopment between 4.6 and 4.7). It lets you easily create new content types, on the fly, without touching any code. It provides a set of primitives, and you can assemble them however you want – even providing lists of acceptable entries.

This is similar to the Flexinode module that’s been around for awhile now, but Flexinode was apparently a proof-of-concept hack that wasn’t intended to be adopted as widely as it has been, and apparently has scalability issues. CCK is sort of like Flexinode, reloaded. There is even a migration path planned to help folks who are heavily invested in Flexinode to move forward to the “modern” way of doing things.

For a demo project I’m setting up, I just created a new “News Release” CCK content type, with the required “Title” field, a text “Abstract” field, a “More Info” URL, and a “Main Content” field. I could easily add “Release Date”, “Agency” or any other News Release related fields. And, any releases created using the CCK content type would automatically have the appropriate fields and widgets provided.

CCK supports several types of fields:

  • date (text field)
  • node reference (select list or autocomplete field)
  • integer (free entry, select list, or checkboxes)
  • decimal (free entry, select list, or checkboxes)
  • text (free entry, select list, or checkboxes)
  • user reference (select list or autocomplete field)
  • web url (text field with URL validation)

When combined with the Views module, you can create pages listing these various CCK content types, displaying whichever fields are appropriate, and providing sorting/filtering tools as desired.

Want to create a Journal Article Review content type? Sure thing! Lesson plan? OK! “Learning Object” reference – maybe even approximating a LOM? Why not? With these primitives available via the web interface (no code required – or even allowed) you should be able to do literally anything… You can even clone/duplicate CCK content types, making it easy to tweak types without breaking existing content.

Seriously cool stuff. Semantically structured content types within Drupal. Kind of like Structured Blogging, but implemented within the structure of the CMS, rather than as a bolted-on xml parsing/generating utility. I’ll be using this on a few projects…

Comments

11 Responses to “Drupal Content Creation Kit”

  1. Heather says:

    D’Arcy,

    I’ve heard a lot about Drupal, but never worked with it. Is there any kind of a “Dummies” type guide for it, or is Drupal not recommended for non-tech geeks (I’m only partly geek)?

    Heather

  2. D'Arcy says:

    Heather, if you have a couple of hours to play around, it’s not that bad to just grab a copy of Drupal and poke around with it. If you don’t have MySQL installed, it might take a bit longer, but it’s mostly just following recipes.

    There’s a decent howto available, which should work fine even though it was written for 4.6 rather than 4.7

    http://maczealots.com/tutorials/drupal/

    As for books, I have the “Building online communities with Drupal, phpBB, and WordPress” book. Not bad. There is apparently a new book – just released – on Drupal 4.7. Don’t have the title handy, but a trip to Amazon should turn it up.

    I really think Drupal should be fine for non-geeks. It might take some time to get familiar, but now that modules are self installing (just drop the files into place, and they take care of initializing their database stuff for you) it’s much easier to use.

    I’m seriously toying with the idea of migrating this blog to Drupal, too…

  3. Thank you for the very informative posting. I have been researching form creation in Drupal, and a lot of ideas that had not been coming together clearly, suddenly made sense after reading this.

    For the past couple years, we have been building something that I think is similar to CCK+Views, but for the XOOPS platform. From time to time, the idea of deploying a Drupal site has come up. I am glad to now know where to start if we ever go down that road.

    FYI, for more information about our XOOPS solution, look here:

    http://www.freeformsolutions.ca/formulize

    –Julian

  4. Having sold the merits of drupal to colleagues I now have the task of porting http://www.i10.org.uk to it.

    We have several content types. What is concerning me is not creating the content type but importing all our existing records into them.

    Any pointers?

    many thanks, Bill

  5. Max Bell says:

    Bill –

    Couldn't figure out what i10 was running, but you should probably check here, first: http://drupal.org/node/271

  6. Ok thanks Max, will do.

    i10 currently runs on a proprietary CMS. We are just looking at options for the future.

  7. dnorman says:

    Failing that, there’s always the “Import HTML” module. It doesn’t appear to run on Drupal 4.7 (yet?) so you’ll have to install a copy of 4.6 to migrate content, then upgrade. It requires valid XHTML, and you just tell it the id of the element containing “content” on the pages. It does its best to create nodes for a site. I’ve done a very small scale test with it, and I’m not sure it’s THAT much better/quicker than just copying and pasting…

  8. dnorman says:

    Views module. You can use Drupal’s native “Promote to front” flag, and use it to define a block or page of items of a particular content type matching whatever criteria you provide.

    The Projects page of the TLC website uses a view that does exactly that (along the right side, the list of images linking to specific featured projects)

  9. Andy Young says:

    I concur! I installed last night and started tweaking CCK. It is great.

    One followup, we’d like to get a list of news articles (our CCK content type) and be able to select which ones should be promoted to the homepage, like this. Do you have any words of wisdom? Is this a task for the views module and, if so, it is possible to create a “Promote to Homepage” checkbox within the content type? It really needs to be idiot-proof, you see…

    Thanks

  10. dnorman says:

    CCK worked out great. Tie it into contemplate.module, and it just doesn’t get any easier.

  11. Andy Young says:

    D’Arcy,

    We’re trying to create a VERY similar News Release node type and list view in Drupal. I was wondering how CCK worked out for you? Any regrets not using Flexinode?

    Thanks for the great posting,
    Andy

Leave a Reply