I thought it might be nice to do a series of module reviews, handpicking some of the more interesting modules which have been released in the last couple of months. As you might know, new Drupal modules are released daily, and while they’re often beta’s or alpha’s many of them have great potential to become very useful, and maybe you didn’t even know they exist.

Tablefield
Take tablefield for example. It offers a simple, lightweight solution – though yet limited in features – to a common problem: displaying a simple table on a page. Of course there are wysiwyg editors which offer this type of functionality, but they require your client to understand how to use these more advanced options, often hidden under a right mouse-click pop-up menu.

Other alternatives would be to display an entire table-view beneath your node. But that is probably more than you need most of the time.

Depending on your needs, it might be enough when an editor could use a simple ‘wizard’ to enter some data, like a pricing sheet, which can be easily updated without having to fear you could mess up the entire layout. This is exactly what tablefield does. It offers a new cck field called ‘tableview’, which behaves like any other cck field. The options are limited to a number of columns and rows, and the first row will automatically be rendered as a header.

Biggest limitations: you can’t (yet) insert a new row or column, and while you can used filtered HTML, if you would like to put a link or image in a cell, it would require manual html input, since all cells are simple textfields. Also, since it’s a cck field, you can’t easily insert the table inline. Maybe integration with the excellent insert module could be an idea?

[Post to Twitter] 

2 comments

  • Bèr says:

    The problem with most CCK-fields is that their datamodel really sucks.
    How is this stored? Any usefull data? Or is the data, like most CCK-fields, only usable inside the field and trough its APIs?

  • Albert says:

    Yes, actually I wanted to do a bit of a ‘code review’ too on these modules, but didn’t get too it (yet) ;)

    The data is first rationalized and then stored as an serialized array in a custom CCK field. So you’re right: it’s not easy to get the data out without going through the CCK API.

What do you think?