In demand


Tuesday, June 23, 2015

CCK vs. Wordpress and Drupal: Custom fields

Adding fields to a content type in CCK is easy.  To do the same thing in  Drupal or Wordpress is complicated and doing  so makes the developer wonder if they are doing the right thing.  This is because Drupal and Wordpress are mixing  content, data types, database entry and  HTML forms.


With Wordpress there is confusion as to what is a content field and what is meta-data for the content.  The fields when added do not perpetuate through to all posts using a particular post type. There is a required amount of programming.
WordPress has the ability to allow post authors to assign custom fields to a post. This arbitrary extra information is known as meta-data. This meta-data can include bits of information such as:
  • Mood: Happy
  • Currently Reading: Cinderella
  • Listening To: Rock Around the Clock
  • Weather: Hot and humid
With some extra coding, it is possible to achieve more complex actions, such as using the metadata to store an expiration date for a post.
Meta-data is handled with key/value pairs. The key is the name of the meta-data element. The value is the information that will appear in the meta-data list on each individual post that the information is associated with.
 Wordpress Documentation


Adding fields to Drupal looks easy until the user wants to choose the type of field to be added. Then there is confusion as the system conflates content, database field types, php data types and html form fields in it's UI data storage and documentation.  No one ever explained to Drupals developers that files are files and characters are characters. The content type fields UI is not supposed to control and manipulate what is being stored  like a database client. The differences between files and images is something for the presentation layer. Number formats do not need to be filtered into the database. Numbers are formatted on retrieval.  Shit! there is just so much wrong with the data structure, system architecture and thinking that it would take years to sort out. The situation becomes even more unbearable when the documentation starts using words like "entities". Many of the nearly 30 HTML5 fields are not available or are only available through third party modules.
  1. Navigate to the Content types page (Administer > Structure > Content types).
  2. In the table, locate the row that contains your content type and click the MANAGE FIELDS link. If you can't find the MANAGE FIELDS link, be sure to enable the Field UI module.

  4. Adding a new field
  5. In the Add new field section, enter a label for the field.
  6. In the Field name field, enter the machine name for the field. You can only use numbers, lower-case letters and the underscore character (_).
  7. In the field type list, select one of the following types:
    short text such as a name (limited to 255 characters)
    Long text
    long, multi-line alphanumeric text such as a biography
    has one of two values (for example: "yes/no" or "true/false" or "small/large")
    List (text)
    select from a list of text options (which can be formatted as either a drop-down list or checkboxes)
    reference to a file (such as a PDF) on the Drupal file system
    reference to an image file such as GIF, JPG, PNG on the Drupal file system
    Term reference
    reference id to an existing Taxonomy Term (or tag)
    a whole number, such as a year (e.g. 2012) or value (e.g. 1, 2, 5, 305); it does not allow decimals.
    a number that can use decimals, such as 0.0123456789
    a number that allows exact decimal values; often used for price or cost (such as $199.99)
    List (float)
    select from a drop-down list of floats
    List (integer)
    select from a drop-down list of integers
    Long text and summary
    same as long text, but with an additional summary text

Drupal Documentation

Content Connection Kit

Once a  content type has been  created in CCK the user may add fields to that content  type which are represented by the almost 30 form elements available to  HTML5. There is a clear separation of  data entry, content and presentation.

 The UI makes is easy to  find and add a field quickly.

Editing a field is just like editing HTML attributes for that form element.

Common end-users of  either Drupal or Wordpress are ignorant of their failings and will remain so. But  web programmers, developers and software engineers should be acutely aware of why they should avoid these CMS's.

Take a look at the CCK demo to see first hand just how simple the system is in comparison. See how on it's own CCK is just better than Drupal  or Wordpress  and why you should be using the Content Connection Kit  for your next web project.

Today's Links

Post a Comment

Print this!