Published on April 13, 2012 by Joel Milne
This is part 2 of a series of posts on this topic, please stay tuned for more if your interested in C5, advancements in CMS systems and Drupal. Part 1 covered the admin, blocks, nodes and themes.
C5 Attributes compared to Drupal Field APII remember when if you wanted to store custom data fields in a CMS you had to write your own CRUD code. Not anymore. Not with Drupal's Field API that allows you to attach a wide variety of data fields to any Entity. For those of you more familiar with D6 and earlier, I'm referring to the CCK module that has now evolved to become the Field API in D7+. One of the things that is really great about the Field API is that we can attach fields not only only to Content Types, but also to Taxonomies and Users.
The C5 counterpart to the Drupal Field API is Attributes. Like the Fieldability concept in Drupal, Attributes enable you to attach editable data fields other data objects. What differs is where that attachments happens. In Drupal, Fields are attached to Entities. C5 in contrast binds Attributes to Pages, Users and Files. Now in the context of the system, binding an Attribute to a Page, is roughly equivalent to adding a Field to a Drupal Content Type.
C5 does not provide automatic display options for its Attributes the way that Drupal does for its Fields. So the first hurdle you might find in attaching Attributes is wondering how to get that information to display. While Drupal will add new Fields automatically to Node Objects for instance, C5 does not do this. Instead you can access the custom Attributes you are using through the API, but that requires coding.
C5 Attributes, like Drupal Fields can be attached to new data objects that you create. So if you are building a C5 Package for instance to display real estate property listings, you might use the Attributes API to store data for the properties such as bedrooms, baths.
C5 Form Helper compared to the Drupal FAPI (Form API)If you have ever loved Drupal it is probably at least in part because of the genius of the FAPI. Though sometimes daunting to newcomers, the FAPI enables fast form creating and processing entirely in PHP. Often more importantly, it allows any form in a Drupal site to be altered using hook_form_alter functions.
C5 provides a Form Helper that reminds me of Code Igniter and other framework form helpers. It promises to save time in form creation compared to writing the full HTML tags. It also handles the data persistence on POST.
The Forms Blocks that comes with Concrete5 is very simple to use for building forms directly inside a page. So for users that just want to create a contact form or another simple form, they will find they can do this with minimal fuss. This compares in some ways to Drupal Webform module, but with far less learning required to use. It also ships with C5, so it is available right away for use.
C5 also provides a Form Validation helper that provides basic testing of form input.