Support Forum
Support › Meta Box Group › Lots of issues with Groups and Nested GroupsResolved
Hi,
Seem to having multiple issues with groups. Extensions and main plugin all latest versions.
'group_title'=>['field' => 'item_title']
'group_title'=>'{item_title}'
If I'm doing something wrong please let me know but tried multiple collapsible settings, disabling plugins and re-enabling (No errors) and getting no where.
$meta_boxes[] = [
'title' => 'Menu Items',
'post_types' => 'ttemenu',
'fields' => [
[
'name' =>
'Menu item<br/><small style="padding-right: 15px; margin-top: 15px; display: block;">Add menu item and their required information.</small>',
'id' => 'menu_items',
'type' => 'group',
'clone' => true,
'collapsible' => true,
'group_title' => ['field' => 'item_name'],
'save_state' => true,
'add_button' => 'Add menu item',
'fields' => [
[
'name' => 'Item name',
'id' => 'item_name',
'type' => 'text',
],
[
'name' => 'Item description',
'id' => 'item_desc',
'type' => 'textarea',
],
[
'name' => 'Multi Pricing?',
'desc' => 'Whether item has multiple prices (eg sml and lrg)',
'id' => 'multi_price',
'type' => 'checkbox',
],
[
'name' => 'Item price',
'desc' => '10.00, 15.00 etc',
'id' => 'item_price',
'type' => 'text',
'hidden' => ['multi_price', '!=', false],
],
[
'name' => 'Multi-Pricing', // Optional
'id' => 'group_id',
'type' => 'group',
'clone' => 'true',
'collapsible' => true,
'default_state' => 'collapsed',
'group_title' =>
'{multi_price_title} - £{multi_item_price}',
'add_button' => 'Add price',
'fields' => [
[
'name' => 'Price Title',
'desc' => 'Pint, pitcher etc',
'id' => 'multi_price_title',
'type' => 'text',
],
[
'name' => 'Item price',
'desc' => '10.00, 15.00 etc',
'id' => 'multi_item_price',
'type' => 'text',
],
],
'hidden' => ['multi_price', '!=', true], // hide if single pricing
],
[
'name' => 'Item tags',
'desc' => 'Select food tags (vegan, vegetarian etc)',
'id' => 'item_tags',
'type' => 'taxonomy',
'taxonomy' => 'menu_tags',
'placeholder' => 'Select food tags',
],
],
],
],
];
Hi Adam
Please see my screen record, I'm using your code to test the field group.
https://www.loom.com/share/a6be54a78970488f8eac30a86a922b88
Sibling groups are collapsed: the new cloning group also collapses because it has the setting 'save_state' => true
The field ID item_title
is wrong, please change it to item_name
. The correct code is 'group_title' => '{item_name}'
.
If you see something wrong, please take and share a screen record of the issue. Thank you.
Thanks for the reply and sending the correct title tag back (was a long day),
I will take a look and if I have any issues will screen record to demonstrate.
Thanks again