-
Notifications
You must be signed in to change notification settings - Fork 30
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
blocks in the big picture #626
Labels
Comments
Closed
1 task
4 tasks
With the GatherPress Block Playground, you can see all the ideas in action! |
The upcoming Online-Event block is already in the Playground and here: https://github.com/carstingaxion/gatherpress-onlineevent-or-venue-block |
1 task
This was referenced Sep 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As GatherPress strives to stay close to WordPress core development, this issue should provide on overview of recent changes within GatherPress' overall block architecture.
Leading goal is to have greatest flexibility while using the blocks, for the end-user and for developers. This could also help lowering the maintenance time needed, to keep GatherPress' blocks in sync with actual WordPress core development.
This involves two main aspects:
1. Flexible block styling and full theme compatibility
As already pointed out extensively, Block Variations provide (actually) one of the best ways to extend WordPress. That's why GatherPress will convert as much of the existing custom blocks into core block variations with the needed extra functionality added.
While block variations seem to be the best option, there are stil some caveats to think about or discuss:
1.1 Caveats of block variations
1.2 Blocks under construction
2. Flexible block handling
2.1 Using the Block Hooks API
Since WordPress 6.5 the Block Hooks API allows to set attributes on injected blocks. Until 6.5 WordPress it was only allowed to hook in blocks by their name. This addition was a necessary need to use this feature in GatherPress, because since we (will) don't have custom blocks anymore.
Currently GatherPress decides what blocks will be loaded by default using the
template
property of the registered post types for venues and events respectively.Instead of loading blocks directly into the editor, we are going to load patterns now. Patterns allow to be filtered by the (upgraded since 6.5) Block Hooks API. Making use of this API brings at some advantages, which are at least:
Therefore GatherPress registers two invisible block patterns, that are used as
template
properties of the main post types.2.1.1 Invisible
event
pattern entry-pointThe following blocks do already implement their hooking:
2.1.2 Invisible
venue
pattern entry-pointThis new (to create) venue-pattern entry-point is used for new posts via the
template
property, as well as asinnerBlocks
property of the new Venue block.The following blocks do already implement their hooking:
2.2 Using slotFills
Similar to the central entry points GatherPress provides with the former mentioned patterns, it provides central administrative entry-points within the editor for all related block options.
Close to the current implementation, GatherPress keeps relevant post data about the currently edited venue or event post within one
InseptorControls
panel, specific for each post type. But instead of defining all editable fields for this panels in two central places, in the future GatherPress will just provide two openslot
s to be filled externally.Every slot belongs to one of each post type. Additionally the venue-slot will be added to the event-slot automatically.
Every GatherPress block registers a fill for either the venue- or the events-slot. Plugin developers could provide their additions to GatherPress within the slots as well, which will help keeping the overall admin interface clean.
All blocks with own administrative sidebar-elements will probably need to register a fill for one of the slots. This actually includes:
Venue
Blank for New Event #151Two combined slots and the registered fills from the blocks will feel the same like the current implementation, but be way more flexible.
Designs
By installing all of my exploration pluginsWith the GatherPress Block Playground, youcouldcan see all the ideas in action, but bringing them to live inside real GatherPress would make me really happy.Describe alternatives you've considered
I haven't considered any alternatives, that's why I'm a little bit scared, about your feedback on this matured proposal.
Code of Conduct
The text was updated successfully, but these errors were encountered: