Hi there....

I have a problem with using drupal hide function with fieldgroups...
I am using fieldgroup to make a node type tabbed, using horizontal tabs...
And have spend hours now trying to hide a field with drupals hide($content['field_name']);
Could not make it work until I tried dragging the field out of my horizontal tabs and to the top of all the other fields, and then it worked..... So I'm guessing this is related to fieldgroup module....

If I wanna hide the body i do hide($content['body']); But should the field naming scheme be different now that it is encapsulated in fieldsets?

Comments

acoustika’s picture

Bump...

No one who have a solution to this?

DaneMacaulay’s picture

To hide a field within a field group you need to call the hide function on the group then the field.

For instance to hide the field "Phone Number" that is within a Group called "Contact" call hide as such:

hide($content['group_contact']['field_phone_number']);

Stalski’s picture

Status: Active » Closed (fixed)

Indeed. If the field is already nested, that's the correct way to do it.
Note that branch 2.x is no longer supported.