Archived topic
Dynamic content in GP2.0 rc2 - questions and suggestions for dev
8 replies · Started by Brad on April 20, 2021
I've been scouring the internet for any useful block plugins that let us *easily* find reference to, and insert, dynamic content into posts. I found toolset, and GeneratePress GP 2.0.
I have purchased all these plugins, and having used them, I have some questions about getting dynamic content into GenerateBlocks and elsewhere, as well as some user-suggestions to make GP2 a total replacement for the alternatives.
1) The holy grail for dynamic flexibility is GP 2.0 elements. It is outstanding. For users wanting to insert dynamic content into these elements, however it lacks.
-Finding a custom field using GP2 should be simpler. Right now, as of rc2, we have to go find the custom field id and past it in. This should be searchable.
-Only background image in Grids, and Headings, have dynamic content that can be added with the GenerateBlocks. - -The Dynamic Content block from GeneratePress blocks only allow you to select from a very limited number of post fields, none of which are custom fields.
2) The alternative, having just released a couple of months ago, is Toolset Blocks.
-As clunky as their entire in fracture is, they have one outstanding feature, which is the ability to add dynamic content to any block from any developer, and even offer an in-line capability.
-I was planning to use this, but found that when creating an element for a hero space, the in-line feature had a bug where it attempts to display the content from the element itself, not the post on which the element is presented (as a Hero, in this case).
-That was disappointing, but then I did find that they have another "block" type which is "Text and Fields". Using this block, I was able to search, find, and insert a custom field that pulled in from the post on which the element was displayed.
My hope in writing this is two fold:
a) Someone will tell me that I am missing something, and that there is an easier way to find fields, and more comprehensive capabilities with inserting dynamic content using GP 2.0.
b) That GP devs will take note of the incredible offering that Toolset is presenting in this block of theirs. The block itself is a block, but their "In-line" version, while buggy on an element, is the golden ticket, and I hope this is on the roadmap for GP.
Here are some screenshots telling the story. Please, GP, develop something like this for us so we can avoid the Toolset framework!
Toolset "Text and Fields" block inserter:


Toolset "in-line" field inserter:

Toolset "in-line" field search awesomeness:

Toolset "text and fields" field search awesomeness:

And here is the result of trying both "Text and Fields" block type from Toolset, in an hooked hero-element from GP 2.0 (sadly, "in-line" doesnt work, but "test and fields: does:

I have tried 3 different services to paste links here... what do you guys suggest for inserting images? Google drive, Dropbox, and screencast all show broken image links. You can right click on the image to open them if they aren't showing for you guys. Let me know if there is a better service to use and I'll update the post.
Hi there,
I have tried 3 different services to paste links here… what do you guys suggest for inserting images? Google drive, Dropbox, and screencast all show broken image links. You can right click on the image to open them if they aren’t showing for you guys. Let me know if there is a better service to use and I’ll update the post.
are you using the IMG formatter? if so, you don't have to. Just paste the link to the image. :)
If you're still looking for service for that, you can try CloudApp or Postimages or Imgur.
As for the questions:
For a.)
You're right about the fields. The dynamic content field for custom field doesn't populate or "auto suggest" existing fields from either default WordPress custom fields or from plugins like ACF.
You'll have to write the custom field slug manually.
For the rest of the suggestions/questions:
Yeah, the field dropdown or suggestion and inline dynamic text string makes sense, I believe Elementor and/or Oxgyen builder had this as well and I remember them being useful. I've raised this as a feature request on the GP Premium Github page.
I'll tag Tom to this as well in case he has something to say.
Hi there,
The only issue I see here is that with Toolset you specify the "Source". This makes it easy to search and display the available custom fields.
With Elements, the "Source" is found for you depending on the page you're visiting. It's highly dynamic and depends on your Display Rules and the page you're viewing on the front-end. You can imagine how insane the list of custom fields would be if we have to search and display every available custom field registered on the entire site.
In the future with GenerateBlocks Pro, we will have a "Source" field you can specify which will allow this to be an option. However, the same issue will exist when it comes to Elements, as they're truly dynamic/reusable/not for any specific source.
As for the inline dynamic text - I'm not sure I 100% understand. Is this the ability to mix static text with dynamic text within the same Headline?
Thanks!
Hi Tom,
I made a video in hopes it would help show you how Toolset has kludged together a semi-working "model" of what you guys could undoubtedly do much, much better.
In essence, I think we are all in need for a full-featured Gutenberg capability to insert dynamic elements in any block (by any vendor). Elementor offers this through via "Dynamic OOO" plugin, but Gutenberg fans don't have anything reliable or fully capable.
Your GP 2.0 is the answer, because the Elements feature is fundamental to the dynamic templating system for Gutenberg, and my hope is that you might consider features to allow us to dynamically insert field values anywhere (where Toolset has tried and failed), and to find them easily via search (where Toolset has tired and been successful).
Video here: https://www.screencast.com/t/vBmLKa17rj
Gotcha, thanks for the video.
Will definitely look into some way to look up the available custom fields. It's strange that their option is working as the "Current Element" is actually a Block Element - it shouldn't have any of the custom fields that appeared in the dropdown. Those should be attached to the page the Block Element ends up getting attached to.
As for inline stuff - it's buggy because the code to achieve it is pretty nasty. It's something I played with and wasn't comfortable with releasing. I don't love needing to depend on "Before Text" either, but it enabled us to use an incredibly simple and performant method to serve the dynamic text vs a complicated and far less performant method. It's definitely something we're going to continue working on as I agree it would be useful, but it has to be stable and performant.
This is great news. Given that we can reference an ACF custom field or Metabox.io custom field using a shortcode, perhaps some sort of shortcodes inserter would be helpful. I've just never found a plugin (yet) that helps with inserting/searching/building shortcodes that also lookup a meta field (ie, an ACF or Metabox.io field value reference shortcodes inserter) - at least not in Gutenberg.
If you have any ideas here, we'd love to hear them!
On the second point on "prepend" limitations - can we keep it just as clean by offering a "postpend" text as well?
I think for now that would be best, although it will have to wait until GPP 2.1.0, as we're close to an official release now.
Thanks again for the feedback!
Update on this - Stackable just released their dynamic conditions - and it's much cleaner than Toolset. Allows you to insert dynamic conditions anywhere in the builder. Where they are (so-far) failing is to allow us to specify dynamic conditions in the options panels for specific blocks (like background color).
You can see their release notes here:
I've attached a video of me using it here, and how we still lack ability to specify dynamic selectors in the options panels (like background color):