Support Forum
Support › Meta Box Group › How to display a nested field?
Hi
I have created a CF-Group "Meals" which contains 4 custom fields (text) with the following IDs:
mo_meal_name1
mo_meal_price1
mo_meal_name2
mo_meal_price2
The ID of the group-field is just "mo_meals"
Now I try to display the subfields using the GenerateBlocks dynamic-data feature, but when I add any of the above mentioned subfield-IDs to a headline, nothing will be displayed.
I found no solution for this in your docs, so can you please help me with this?
Thank you in advance and kind regards,
Sascha
Hi,
It looks like GenerateBlocks is not fully compatible with Meta Box and pro extensions like MB Group to display subfield value. You can try to contact their support to ask for help with this case.
Or create a shortcode to display subfield value and add the shortcode to GenerateBlocks. Refer to this documentation https://docs.metabox.io/extensions/meta-box-group/#outputting-group-with-page-builders
Hello,
thank you for your reply.
Unfortunately, I'm not a coder, so I wonder if you can help me further here?
The docs seem to include code, but not all of it seems to be required if MetaBox AIO is installed, correct? The doc you've mentioned explains how to create the group, subfields etc. But I have already created the group using the Metabox UI in the dashboard of the site. Therefore they're displayed in the block-editor already and can be filled by admins, editors etc., correct?
In my understanding, as soon as the MB Group is created, I can display all fields in the frontend using shortcodes. I just don't understand, how to display these fields via shortcode. The docs are confusing for me 🙈
Can you please show me or provide the shortcode to display the cloneable subfields mentioned above?
Thank you in advance and kind regards,
Sascha
Hi,
The sample code is already added to the documentation (section Outputting group with page builders), please check it here https://docs.metabox.io/extensions/meta-box-group/#outputting-group-with-page-builders
If you are not familiar with coding, you can use a page builder like Elementor, it fully compatible with Meta Box, MB Group to display subfield values.
Or hire an expert developer to help you to build your site.
Thanks for further clarification, that was helpful indeed.
So in this example, I would replace the group_field_id
with montag_gerichte
, if the group is created like seen on this screenshot? Or is it the ID menue-cf-group
?
Thank you in advance and kind regards,
Sascha
Hi,
You should replace group_field_id
with your group field ID montag_gerichte
. The ID menue-cf-group
is the field group (meta box) ID.