Subgroup values in elementor
- This topic has 6 replies, 2 voices, and was last updated 3 years, 8 months ago by
Long Nguyen.
-
AuthorPosts
-
April 4, 2022 at 7:11 PM #35450
Yasmine
ParticipantHello, how do I use group values in Elementor pro in a different way to your standard table?
For example, in my MB frontend submission, I ask for a description and a relevant link. I want to show this data as the description and next to it a button with the dynamic link they added.
I tried to create a loop to do this, but could not get the sub-group metabox values. How do I do this?
April 5, 2022 at 12:49 PM #35467Long Nguyen
ModeratorHi,
You can create a shortcode to display the subfield value on the frontend. Then you can insert the view/shortcode anywhere with the page builder. Refer to this documentation https://docs.metabox.io/extensions/meta-box-group/#outputing-group-with-page-builders
April 7, 2022 at 2:07 PM #35510Yasmine
ParticipantThank you - this is exactly what I needed.
Just to clarify this application is possible - if I create shortcodes, can I ensure every group value is displayed together.
For example if I have a group with sub-fields for a word and its definition, and I want to make one long list (like a glossary). One user can contribute up to 5 words, but the list will include all the words of multiple users.
If I use a loop with using the shortcode, will it 1. Always match the subgroup values together? and 2. Can I use to display every value in custom order -eg take all those words from every user and reorder on one page - to achieve something like:
A Word 2 Definition 2 (from user 2) B Word 8 Definition 8 (from user 4) C word 3 Definition 3 (from user 2) D word 1 Definition 1 (from user 1) E word 4 Definition 4 (from user 3) F word 5 Definition 5 (from user 4)April 12, 2022 at 3:06 AM #35569Yasmine
ParticipantHi Long - just wanting to follow up on this, before I migrate all my fieldset over to a group..
April 12, 2022 at 10:07 PM #35594Long Nguyen
ModeratorHi,
If you use the frontend submission form to submit posts with the group field, the group and subfield values are associated with the post, not the user. And it is the custom code so you can output the value in any format you want.
April 13, 2022 at 11:32 PM #35620Yasmine
ParticipantGreat - so that means I just need to reference every post to get every value?
April 14, 2022 at 6:49 AM #35625Long Nguyen
ModeratorHi,
Yes, you can query to get posts then get the field value associated with the post by post ID
rwmb_meta( 'field_id', '', $post_id ); -
AuthorPosts
- You must be logged in to reply to this topic.