More extendability for Post Date block variation #67882
gvgvgvijayan
started this conversation in
Developer Experience
Replies: 1 comment 3 replies
-
Hi, instead of using block variations, how about using the Block Bindings API? For example, you can bind any custom field to a Paragraph block. The bound data will be displayed correctly both in the editor and on the frontend. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue:
I'm developing a block variation of core/post-date for custom post type
Event
where I achieved to show event date (post meta) instead of created or modified date in front-end but in editor the markup is showing the hard coded labelPost Modified Date
because the attributedisplayType
initialized with custom value in variation's JSON.Suggestion:
Instead of hard coding the label, if
dateLabel
property is passed using variation's JSON then we can show custom label likeEvent Date
instead ofPost Modified Date
. Even better is it possible to pass the date dynamically, I think this is not possible for now because of not possible to extend the editor markup. But if possible, please give a provision to pass/hydrate custom inner block as a date template.Gist of what I'm doing:
index.js
event-date.js
event-date.php
Beta Was this translation helpful? Give feedback.
All reactions