I see ACF integration has been added for 1.4, but I see no difference in the dynamic data options. I’ve already been using ‘post_meta’ to add ACF fields, so is there a different method now?
I don’t see it, and there’s no documentation for a change either.
Regarding ACF integration, I’m not sure a great move for GB. Sure, ACF is a popular plugin but such reliance on 3rd party plugins is moving into a dangerous ground IMHO.
I would of preferred a simplified ACF system within GB so that the system is integral. There is a fine line where a lot of development time and feature enhancements are being made in making something ‘compatible’ with something else, only to find that something else if bought out and affects the functionality of the core.
More core functions to make GB Pro a ‘must have’ Swiss army knife plugin for Gutenberg would be the way forwards I would say. Keep it simple, and make the core system able to create ‘anything’ with a minimal set of block structures.
A simplified ACF system within GB would be perfect for my use, sounds like a great idea. I really only use text fields - H1, H2, some paragraphs too.
But the integration is in the changelog for the latest release…I just can’t see that functionality in the editor. Or no difference at least.
Before ACF integration even tho you were allowed to add your custom meta values you didn’t have a live preview of the value on the editor. Also, they weren’t showing in the select field, now they should all appear.
For more complex fields like the post relation, you can now choose what field from the post object to display as well. In the future, we will bring repeatable fields as well.
Ah, also in the front-end now you have your meta values formatted properly as you defined on ACF.
Regarding GB + ACF integration, we are not creating any kind of deep relation with the plugin, it’s just a couple of filters to improve the quality of life for users that rely heavily on ACF fields. The only thing we use from ACF is the function
get_field if that exists.
About GB having some sort of meta field functionality built-in I don’t think that’s a good idea, personally, I think it is better to keep these low-level integrations with plugins that do that already and do it well, instead of trying to recreate something that’s already well made. (Personal opinion here )
Hi Jean - the question I have is that I don’t see the changes you describe above. Adding a custom meta value is the same process as previous, there is no live preview in the editor just ‘post meta’. There are no new options in the select field to choose from.
I will test the front-end formatting soon - previously date select fields from ACF were displaying with the full date and timestamp, ignoring the option I had set in ACF.
Can you maybe post a video/screenshots of the new editor options?
For meta values I don’t see a change either - a date set as ‘October 5, 2022’ in ACF is still displayed as ‘2022-10-05’ front-end.
@paulbursnall created a quick video to try to demonstrate how the integration works. Hope it helps.
Hi Jean, I didn’t have the REST API option enabled, but unfortunately the fields still don’t show as they do in your video. I’ve deleted and recreated a test ACF group but the new field still isn’t available to select.
@paulbursnall do you have GB 1.6 and GB Pro 1.4 installed? There’s any error or something in the console?
I believe it currently only works when directly editing the Page or Post the fields are on. Elements and Custom Post Types still use the original method with no preview or select option.
If it could be a future feature that would be great, because I almost always add ACF as either a post template or block within elements.
That’s true @jessefisher, thank you for pointing it out. The problem with elements is that it depends greatly on the rules you set, so the GenerateBlocks does not know where to gather the data.
But we are experimenting with ways to pass a fake post to GB based on the rules set in your element, but still a work in progress.
I’ve tried this process on two separate WP installs and the test field created isn’t listed under Dynamic Data. GB 1.6 and Pro 1.4 on both sites. Disabled all other plugins, purged Siteground cache etc. Like Jesse I would prefer this to be available in Elements, but to test it working at all would be good.
I like the idea about having some lightweight ACF alternative. But since GeneratePress has the elements system I think it probably fits better there than in GB. Or as a separat plugin altogether.
I was looking for a lightweight alternative to ACF myself and found: Custom Field Suite – WordPress plugin | WordPress.org English (UK)
However its date field does not support time and there is no time field. Since the developer is expressively unwilling to have this feature I went with ACF anyway.
does this work as shown in the video also in elements? inside query loops?
all the best
@htaitl yes, it should work fine inside a Query Loop that is inside a GP Block Element.
I’ve never been able to get the ACF field to appear in the content source list. The custom field is created, shown in rest api, populated on a post itself…still doesn’t show in the content source list.
@paulbursnall which browser you is using? There are any console logs shown? Any error apart from values not showing?
@JeanPaiva please disregard - I hadn’t select posted meta before looking for the custom field
I can now return a date & time in the correct format front-end, very useful
By “original method”, do you refer to adding a php function into the child-theme to get the field and display it on the frontend?
No, GenerateBlocks has been able to get ACF meta data and show it on the frontend long before the 1.4 release, which is what I was referring to. 1.4 added the ACF field names to a dropdown list and shows the field value in the editor as well as on the frontend. These new features only work when editing a page or post the field is on though. For Elements and Custom Post Types you still need to type or paste the field name in yourself and there is no preview of the field value in the editor.
The ACF support has only ever been for simple fields though (text, textarea, URL, etc.) so if you are adding a repeater field for example you do need to add a PHP function to get the meta data and then either use a hook to place it on the frontend or turn it into a shortcode that can be added in the editor.
The team have mentioned repeaters are on the road map.