[SOLVED][Drupal CCK] How to show CCK field labels even when there's no content in the field

| | 1 min read

The default behavior for Drupal CCK fields is to hide the labels when the corresponding field is empty. However there maybe situations where you need to show CCK field labels even when there's no content in the field to indicate to the users of your Drupal website that there is a category present. There are a variety of solutions to override this behavior in your Drupal. Read on to find out more.

Here are the possible solutions

  • Install the Drupal Content Templates module which should take over the task for you. However this can be considered overkill for such a small fix.
  • Install the Drupal Advanced help module and check the 'Theming CCK data in nodes / Field templates' section for more information if you're not familiar with templates overrides in D6
  • Using the help of this module you would be able to see that the default content-field.tpl.php template starts with
    a
  • 
    (...)
    
    
  • Simply remove the enclosing test code for the field of your choice to enable the fix..

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more.