-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider allowing dynamic content from meta fields to be inserted inline in Paragraph, Heading, List, etc. #6665
Comments
Also check out the "slot" concept on this issue |
Thanks for the suggestion, @SuperGeniusZeb. I've filed this to the |
I've seen this mentioned multiple times so I'm just curious... Where is this |
Ah gotcha! Thanks 👍 |
How come this issue was put into a project and closed, and then that project was closed? That seems like a really unusual way to concatenate issues. |
I've been told this sort of thing is now possible to implement with the Format API. Not exactly sure how to use it to do this, but in case anyone is wondering if it's possible with the existing APIs, this should help. |
This issue was originally intended to suggest that a visual UI be added for inserting inline dynamic content, but in hindsight, I think that's something best left to plugins, at least until there's noticeable demand for the feature. The upcoming full site editing and related blocks will likely provide the functionality most users are looking for. Since it is technically possible for plugins to implement this now, I'm leaving this issue closed. |
Actually, it looks like it might be a bit difficult to implement this? See #18490 for continued discussion. |
The issue and how existing page builders have solved it
Currently, there is no easy way to have inline dynamic content sourced from custom (or even non-custom) fields in Gutenberg.
Somewhat recently, Beaver Builder has gained the ability (through the official Beaver Themer extension) to easily insert dynamic content into any text or image field from any meta field, including (but not limited to) featured image, post title, post date, post modified date, excerpt, archive, site title, and any custom fields.
I highly recommend checking this feature out and playing around with in the demo to see how it works. It is quite powerful.
https://www.wpbeaverbuilder.com/beaver-themer/
Elementor Pro has also gained this functionality recently, albeit slightly less powerful: you can only have the dynamic content take up the entire text field, whereas Beaver Themer allows you to use it mixed in with standard static content by using the Insert button instead of Connect. (The Insert button uses a shortcode.)
https://elementor.com/introducing-theme-builder/
Divi is also working on implementing this same functionality in pretty much the same way as Elementor Pro:
https://www.elegantthemes.com/blog/theme-sneak-peeks/divi-feature-sneak-peek-dynamic-content
Approaching the issue in Gutenberg
Technically, you could just use some kind of shortcodes plugin to add dynamic content from fields into text inputs. However, Gutenberg is aiming to replace most, if not all shortcode usage. Therefore, I think that Gutenberg should have some kind of system in place for inserting inline (or in some cases not inline, but still within an existing block) dynamic content sourced from fields into text inputs (and possibly also image inputs).
Some example use cases:
post_content
, the Heading block could be re-used for the Post Title without having to create a dedicated Post Title block.As for how to implement it, the first idea that comes to mind is doing it through the inline block/token system proposed by #2043. The only flaw I can think of at the moment to doing it through that system is that it does not provide a way for the dynamic content to be used in inspector inputs that are not shown outside of the sidebar.
Assuming I understand the inline block/token system, it seems like it could also allow for things that none of the page builders do right now, like an inline block/token that lists the categories, tags, or other taxonomical terms of a post. There are definitely some exciting possibilities to look into there.
Related Issues and/or PRs
#1851
#2043
#6663
The text was updated successfully, but these errors were encountered: