This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Drupal's Field API

I 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.

concrete5's Attributes system

The concrete5 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. concrete5 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.

concrete5 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, concrete5 does not do this. Instead you can access the custom Attributes you are using through the API, but that requires coding.

concrete5 Attributes, like Drupal Fields can be attached to new data objects that you create. So if you are building a concrete5 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.

Adapted from concrete5 From a Drupal Perspective by Joel Milne

Loading Conversation