Expanding on editor-only blocks #149
gregsullivan
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello—And thanks to Fabian for all his work here and on
10up/block-components
!I'm starting to use editor-only blocks as described on the custom post types page (in conjunction with components from
10up/block-components
).There were two things I was wondering coming out of this initial experimentation:
Locking a "header" editor-only block
In cases where to goal is for something of a "header" block for PostMeta components and the like, with all other blocks available to added, removed, moved, etc. below it, is there a suggested approach for locking the header block to the top of the editor? My approach has been to set
lock.move
andlock.remove
to true, and then to use custom JavaScript to move the block back to the top position if another block is moved above it.This is not without its downsides: The header's block menu has an option for "Add before" that will add after, and the block that follows the header has an arrow indicating it can be moved up.
Has anyone found a better way? My dream would be something like
lock.position
with options forfirst
andlast
, but I think adding that functionality would be fairly involved.Replacing the post title field with a block component
I've often had clients request the ability to add italics (and sometimes bold) to post titles. This would be possible with a PostTitle block component in a header block, and I could simply hide the standard post title field.
Is there any reason why this might be a bad idea? I did a proof of concept, and it worked as expected.
Beta Was this translation helpful? Give feedback.
All reactions