Open socialblogsite opened 9 years ago
Unfortunately I haven't had time to write up any documentation for this plugin. Can you give me a specific example of what your setup is and I can try to test? There are definitely bugs when using this inside repeater fields and flexible content fields that I just haven't had time to fix, but I can try to take a look at what's happening and point you in the right direction.
Or I'd happily accept a pull request if you find the bug on your own.
Darn, I just deleted the group until someone can replicate it, and I didn't export the php :(
But it's very simple: (despite the naming I used to get brains easier to digest it)
I have a field group G1, that shows in a custom post type.
G1 has only one field G1-F1, which is a flexible Layout type.
Inside that field, I have three "layouts":
G1-F1-L1,
G1-F1-L2,
G1-F1-L3.
G1-F1-L2 has several subfields:
G1-F1-L2-s1,
G1-F1-L2-s2 -> the reused group R1
G1-F1-L2-s3,
etc.
Reusable Group R1 is setup to show on an "option page" (so it doesn't show twice in my custom post type. I assume the "shows in" setting doesn't matter since reusable fields ARE designed to show somewhere else, right?)
R1 has two fields
R1-f1
R1-f2
When the post editor loads, I can see fields f1 and f2 correctly inside sub-field s2 in the right layout.
I can save them and their values retrieve fine.
Then in my template, all the fields are retrieved fine, as e.g. get_sub_field( name_of_G1-F1-L2-s2_here), but that returns null (properly inside the has_rows loop. Every other sub-field is working fine)
Are they supposed to be retrieved rather as get_field() instead of "sub"? I don't remember if I already tried that but if I did it didn't work)
If the solution is to set the original group B as "show in" [the custom post type], and I DON'T want it to appear twice in the post editor, how should I hide the one outside the flexible content metabox? with CSS? JS?
If this works I will re-create the 43 repeater fields I was working on, (it has actual content), copying from the current sub-field, to paste in the sub-field-reused-group-field if necessary, but I definitely like your plugin to group several fields inside the same table-column, rather than wasting space with one checkbox per column (so there's more room for the columns with a post editor in them)
Thanks for your time.
Some basic info/usage (code examples) as mentioned above would be great :) Struggling to get this plugin to work.
A reusable group field used in a flexible content layout returns null when I dump the content of the repeater's sub-fields)
I haven't found documentation anywhere to retrieve the field's data. I just realized they could be designed to be retrieved as regular fields, not sub-fields.
Can anyone lead me to some documentation/support link?
Is it possible it returns null because the post type for the source fields group doesn't match the current post type? (Using the same one makes the group to appear twice in the post editor)