-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
How to have both static and dynamic content in the same block #7568
Comments
So, that's not possible yet? |
Mixing dynamic rendering together with static content generated by gutenberg directly is currently (version 3.1.0) not possible as far as I know. |
I would create a Once defined, this attribute will appear in the Maybe I'm bad at explaing it, but the Latest Posts core block is a good example of combining Static attributes with server side rendering. |
I know for that one since that's probably the only way. However, in that case I would need to have two extra fields like BEFORE number and AFTER number content fields which is really now user friendly if you know what I mean. |
Closing as duplicate of #5760. |
Is it possible to have a block which will render on the server and also have a static text before the dynamic content?
For instance, I've converted a shortcode to a Gutenberg block and upon edit I do this:
el(ServerSideRender, {
block: "example/shortcode-name",
attributes: props.attributes
}),
which retrieved the content rendered on the server (in this case, it gives the number of sold products - pure number). That one works like a charm.
However, I'd like to have results like this "Sold: 56" or "56 Sold Already" instead of just getting "56". That "Sold" or "Sold Already" would be a static input by a user.
Thanks in advance!
The text was updated successfully, but these errors were encountered: