Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.7
Component:
General
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2010 at 14:38 UTC
Updated:
12 Aug 2010 at 10:40 UTC
Anyone else having trouble hiding labels on CCK fields? I've tried to hide them on /admin/content/node-type/page/display, but that didn't work. I've also created a hook_form_alter module to try achieve the same thing but that did not work either ($form['field_name']['#title'] = '')
I've tried this on different types oc CCK-fields - numbers, text, etc.
It works on the regular Title field and taxonomy field though.
Comments
Comment #1
DrupalNovice commentedPlease ignore my dumb attempt to try to hide labels on the form using the options on /admin/content/node-type/page/display - they're meant for the node rendering itself.
I am having difficulties hiding the form labels though - regular form items that are created by the system module can easily be hidden through the _form_alter hook, but I am unable to achieve the same effect on the CCK fields.
Any ideas on this?
Comment #2
DrupalNovice commentedAnd the answer is: Use the following in your _form_alter hook:
$form['field_name'][0]['#title'] = '';