Closed (fixed)
Project:
Field Group
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2011 at 17:29 UTC
Updated:
10 Apr 2019 at 07:19 UTC
Jump to comment: Most recent
Comments
Comment #1
Ehud commentedSubscribing
Comment #2
ndeschildre commentedHello,
I just happened to search for it, and came up with this working bit of code:
Comment #3
acbramley commentedThanks @ndeschildre that worked great, think this should be closed now.
Comment #4
tariqinam commentedHi,
Not sure how it worked for you. Because array key name must match with database field name. And They are:
| entity_type | varchar(32) | NO | | | |
| bundle | varchar(128) | NO | | | |
| mode | varchar(128) | NO | | | |
I have to use following format to get it working. let me know if i am doing something silly here.
$groups = field_group_read_groups(array(
'entity_type' => 'node',
'bundle' => 'bundle type',
'mode' => 'view_mode_name'));
Comment #5
srinivasraod commentedHi,
You can try with with this if you get an empty array....
$groups = field_group_read_groups();
$your_group = $groups['node']['article']['form']['group_your_group'];
$your_group->children[] = 'field_your_new_field';
field_group_group_save($your_group);