Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterGlad to hear that the data migration works well. It'd be a pain if we loose data.
I tried again with your code and I see that the last field doesn't have enough columns (8 while it should be 12 to fill in the row). It's a note that each row must have enough 12 columns, here you have first row with 2+10 columns, 2nd row with 4+4+4 columns and 3rd row has only 8 columns.
I tried changing 8 to 12 and it works fine to me:

Anh Tran
KeymasterHi eisenrith,
The MB Builder plugin helps you to create meta boxes and custom fields for posts in the back-end faster than traditional way (traditional way is registering via PHP code as described in this docs and this docs).
This extension doesn't mean to show meta values in the frontend. To do that, you need to use a helper PHP function
rwmb_meta()to retrieve meta value and display it. Please follow this detailed instruction and if you need any help, please let me know.Thanks
Anh Tran
KeymasterHi,
I've tested with your data and here is my result:
1. I use the following code to add data to a post:
https://gist.github.com/rilwis/452dec0295484a455875#file-add-data-php
2. Then I register a meta box with following code:
https://gist.github.com/rilwis/452dec0295484a455875#file-register-meta-boxes-php
And here is final result:
I think it works for me. Can you check the code to import data and register meta box again? If you need any help, please let me know.
Anh Tran
KeymasterSo it's solved now?
If you need me for anything, please let me know.
Anh Tran
KeymasterHi Andy,
I've just checked your code and it works for me: http://prntscr.com/6cft18
Can you please check again?
Anh Tran
KeymasterI think there is a misunderstanding here:
- The Group extension is just one kind of field (special one), it acts exactly like other field type like
text,file, etc.
- The techniques to show/hide meta boxes are applied for meta boxes only, not for fields, so they're not applied to groups.But you can do a tricky way like this to achieve what you want:
- Create a meta box
- In that meta box, define only 1 group and put all fields under this group
- Use techniques above to hide whole meta boxBecause this meta box contains only 1 group, show/hide this meta box actually show/hide this group.
Hope that helps. If you need anything, please let me know.
Thanks
Anh Tran
KeymasterHi Maxell,
Sorry for late reply, I had a problem with email sending :(.
Regarding your questions, it's not possible now to show/hide a specific field (which is in the development plan) and tabs (no plan yet).
Your ideas are very nice, I'll think about that. Thank you very much!
Anh Tran
KeymasterThe
better-include.phponly add conditions to show/hide whole meta box for a specific page, so it doesn't affect Group extension. Just define groups as normally, nothing changed.Anh Tran
KeymasterHi, that's great. I thought about the same idea, but didn't have time to implement that. If you don't mind, can you share with other people via a pull request on Github?
Anh Tran
KeymasterYes they do. They all work together. Please try.
If you need any help, please let me know.
Anh Tran
KeymasterI'm sorry for that confusing. I've just updated the Tabs extension to make it work with Group extension. Please update the Tabs extension.
Here is the sample code to create 2 tabs, each tab contain 1 group (clonable):
Anh Tran
KeymasterHi,
I'm afraid Group and Tabs can't work together. Both these extensions change the way fields output HTML and unfortunately these ways are not compatible to each other (Group is using output buffering to capture all sub-fields output, while tabs does not).
The only good news is both of them can work with Columns extension :). So I think you should separate fields into several meta boxes: some use Tabs, some use Group when possible.
Anh Tran
KeymasterHi,
How did you convert existing data to group of fields?
Anh Tran
KeymasterHi,
All you need is just specify
post_typesparameter for meta box when define it. This parameter is optional and gets default value ispost. So if you want to set meta box forpostonly, you can ignore this parameter as I did in the sample code.For more information, please see this documentation.
Anh Tran
KeymasterHi brainbytescreativellc, as riseoflex88 said, it's not possible for now. The hardest part of cloning image field comes from how it saves data. But if you want to clone a single image, you can use the
file_inputfield, which allows you to select only 1 image and saves image URL as meta data. -
AuthorPosts