Forum Replies Created
-
AuthorPosts
-
April 12, 2019 at 2:06 PM in reply to: Displaying Group Meta Array via Astra Child & Beaver Builder #14136
Anh Tran
KeymasterHi Sam,
Showing group in a page builder is not supported yet. We're figuring it out the best way to do that.
The only way to do it now is via custom code. And please follow this docs:
https://docs.metabox.io/extensions/meta-box-group/#getting-sub-field-value
The group value is an array of sub-fields' values. So you need to extract them from the outer array. Let me know if you need any help.
Anh Tran
KeymasterHi, thanks a lot for your feedback. I've just fixed and released a new version. Please update.
Anh Tran
KeymasterHi kesit,
Please make sure all field IDs match the table columns. I see at lease
konsumen_idfield doesn't have a column in the table.Anh Tran
KeymasterHi Matthias,
Looks like we fixed only for the non-clonable groups. Let me check and fix for cloneable groups.
Update: I've just fixed this bug and release version 1.3.3. Please update.
April 12, 2019 at 10:36 AM in reply to: ✅MB fields placed After Title are not visible when using Gutenberg Block editor #14132Anh Tran
KeymasterAh, I got it. That's what we plan to do this year!
Anh Tran
KeymasterHi Sadiq,
Please try to follow these steps:
- Create a new custom post type for teams, you can use MB Custom Post Type to do this.
- Create a meta box like this:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = [ 'title' => 'Matches', 'fields' => [ [ 'id' => 'matches', 'type' => 'group', 'clone' => true, 'collapsible' => true, 'fields' => [ [ 'id' => 'league', 'name' => 'League', 'type' => 'text', ], [ 'id' => 'team1', 'name' => 'Team 1', 'type' => 'post', 'post_type' => 'team', ], [ 'id' => 'team2', 'name' => 'Team 2', 'type' => 'post', 'post_type' => 'team', ], ], ], ], ]; } );PS: Please take the code as a starter point and try to follow the docs for Meta Box and MB Group. As you're the one who knows what you want exactly, you should do the code. I can just only help, but can't do that for you.
April 9, 2019 at 4:04 PM in reply to: ✅MB fields placed After Title are not visible when using Gutenberg Block editor #14099Anh Tran
KeymasterHi,
Gutenberg removed the hook for meta boxes after title, and there's no way to do that. The WP team said that they will turn the post title into a block itself, so there's no fixed position.
It would be nice to have a MB Block (reusable?) selectable or a separate one for each MB Group/Field one could place in the Block column so you could edit in full width.
Can you explain this? I'm not sure I got it.
Anh Tran
KeymasterHi Ryan, I think the validate method works only once, e.g. if you implement a validation on the form, then Meta Box's validation won't work.
A simple workaround is copying the code from validate.js to your file.
Probably I'll make this feature in the next version. Letting you or other developers doing this seems a little bit confusing.
Anh Tran
KeymasterHi Sadiq,
Regarding the first question, I think you can do that with MB Group. You can create a repeatable group with fields: league, team 1, team 2, etc.
Regarding the 2nd question, yes, you can get field value with helper functions or shortcode.
Anh Tran
KeymasterCan you please try this fix and let me know if it works? I'll release new version when it's confirmed.
Anh Tran
KeymasterHi Dave,
I see the problem. At the moment, the conditions works only if both fields are in a same group clone. I see the module type is outside of the group where the editor belongs to. So it’s not working.
Anh Tran
KeymasterHi,
Thanks for your feedback. Let me check the issue.
Anh Tran
KeymasterHi Aaron,
Unfortunately, it's not possible yet :(.
Anh Tran
KeymasterYou mean including custom fields in the response of WP_Query?
If so, then it's not supported. That might lead to a query performance. I think it's better to do something like this:
$query = new WP_Query( $args ); while ( $query->have_posts() ) : $query->the_post(); $field_value1 = rwmb_meta( 'field_id1' ); $field_value2 = rwmb_meta( 'field_id2' ); // Do what you want. endwhile;Calling helper function or
get_post_metafunction inside a loop is a better way, sinceWP_Queryalready cache all post meta and they don't create any extra query to the database.Anh Tran
KeymasterHi Dave,
The condition looks simple and should work. Do you put them in different groups?
-
AuthorPosts