- This topic has 13 replies, 5 voices, and was last updated 3 months, 1 week ago by David.
February 19, 2020 at 4:01 am #1170117Marcel
First of all, I want to congratulate you on the launch of the Generateblocks plugin, the whole community has been looking forward to this. I’m sure it will be very successful.
However, I would like to ask you, if I could integrate some custom fields, made with ACF Pro plugin, into the blocks made with Generateblocks. Unfortunately, using shortcodes only works for simple text-based values. I would need all kind of values, not just text.
I would be very happy if there was any such integration, otherwise, I would have to use the ACF blocks, but it would be more work, in the sense of customization from a visual point of view.
Thank you and wish you much success with Generateblocks!February 19, 2020 at 7:39 pm #1171042TomLead DeveloperLead Developer
What kind of integration are you looking for, exactly? What would those custom fields output? In which of our blocks?
I appreciate the feedback! 🙂February 24, 2020 at 4:05 am #1175049Marcel
The idea would be to get the values added on ACF fields and place them on the Generateblocks’ blocks. It is something similar to how Elementor uses ACF fields values. This kind of integration I was looking for, but it seems to be complicated.
Now I can use the ACF Blocks feature to achieve this.January 22, 2021 at 12:28 pm #1629763Sam
Here’s an example I’m currently trying to figure out.
I have two custom fields the client can edit:
Ideally, I can use a GB Headline block set to Paragraph, and edit the HTML to do this:
<a href='tel:[acf field="phone_number_dialer"]'>[acf field="phone_number_display"]</a>
When I try that now, the GB block converts my single quotes for the href into double and converts the double-quotes inside the brackets into
". Escaping them inside brackets doesn’t seem to work.January 23, 2021 at 8:00 am #1630528DavidStaffCustomer Support
you can create your own shortcode that returns the HTML and the ACF Fields. Here’s an example from ACF Support:January 23, 2021 at 2:15 pm #1630802Sam
That did the trick! Thanks, David.January 23, 2021 at 3:39 pm #1630850DavidStaffCustomer SupportJanuary 24, 2021 at 9:21 am #1631644TomLead DeveloperLead Developer
This seems like it would be useful when coupled with something like our Elements module, but not too useful otherwise. Am I right?
In the next version of GP Premium, we’re adding dynamic fields to GenerateBlocks inside our Block Elements.January 24, 2021 at 11:21 am #1631767Sam
That was my intent, but I think it’s useful anywhere site-wide data is needed.
For example, I created Site Header and Footer blocks (Elements), and wanted them to display the client’s contact details (phone, email, region) across the site.
My mistake was adding custom fields (with ACF) to the Elements themselves and expecting them to be displayed throughout the site. (Post ID’s/queries would be different from the Element posts, so the custom field data wouldn’t be available anywhere else. Lesson learned.)
After more reading, I discovered ACF options pages, and created one for the contact details. Then, with David’s helpful link, I created a shortcode to query and return data from the options page, and placed that shortcode in my site header and footer Elements.
It’s kind of hacked together, but accomplishes what I wanted: one central place for my non-tech savvy client to update their contact information so it’s automatically updated site-wide. Now the site header, site footer, and their Contact page are automatically updated without them touching page or Element/block content directly.
Super glad to hear this is coming to GPP!January 24, 2021 at 3:59 pm #1631926TomLead DeveloperLead DeveloperFebruary 10, 2021 at 12:25 pm #1653574Samuel
Will there be a link for public testing? I have a project where I created several shortcodes to get around this kind of issue. Would love to solve this in GP/GB without additional shortcodes.February 10, 2021 at 2:39 pm #1653690TomLead DeveloperLead Developer
Yes, once available you’ll be able to download it in your account, or opt-in for updates via your Dashboard: https://docs.generatepress.com/article/beta-testing/June 20, 2021 at 2:52 pm #1828927madpiotr
I would like to be able to add acf field as an option to Generateblocks.
My field is a select field with diffrent colors which I just accross the website (also I am adding new colors there – I use clone option form acf).
The best would be if I can add this select box as a class to container or replace field add custom class(es) which standart ist input.
Is it possble to achieve it?
ThanksJune 21, 2021 at 3:51 am #1829341DavidStaffCustomer Support
this topic should be for the GB Support Forum or better still raised in the GB Community Forum:
If you can raise a topic over there and explain a little more of how this is being used we can take a look
- You must be logged in to reply to this topic.