-
Notifications
You must be signed in to change notification settings - Fork 27
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 add a functioning breadcrumbs & undo/redo functionality? #6
Comments
I managed to get the BlockBreadcrumb component working by adding it within the |
Hi @patricklindsay. Glad you found this useful. I've never actually tried to take this beyond what was in the original tutorial so it's great to see things being stretched a bit. The I'm afraid I'm not actually sure how to get It does feel like breadcrumbs should be part of the Block Editor package so perhaps one good option might be to drop into the Core Editor Slack channel and see if anyone there can advise. Failing that do you have any public code you can link to? |
Ok thanks. The code is public although it's within a Rails engine and so far the only change I've made to the tutorial (excluding block additions and customizations) is adding the 3 components into the custom block editor component. The Rails app to test this out on is available at https://github.com/yamasolutions/integral-sample/tree/block_editor_spike |
@patricklindsay I've spoken with a few folks. Essentially the Undo/Redo from the Editor package selects and dispatches from its own store to get the undo/redo state. If you look in the action creators these in turn proxy the actions across to the Perhaps you should create your own Undo/Redo components basiing them on the ones in the Editor package. Then you could copy the same actions as the Editor store has into your store and see if that works. I tried this and it didn't work, but I suspect I'm missing something which actually creates the undo levels. Shouldn't be too hard to find but I've run out of time today. Take a look at this branch I made https://github.com/getdave/standalone-block-editor/tree/try/undo-redo |
@patricklindsay I've found a moment to work on this. Please do take a look at #15 and let me know what you think. |
Thanks for the tutorial @getdave ! With no react XP I've used this to create an editor outside of the WP env and it's working great.
Could you give any pointers on how to add the BlockBreadcrumb component ?
After working through the tutorial I tried to do this myself by adding the following snippet into the Editor component, the breadcrumb component is now rendering and clicking on 'Document' does deselect blocks so it's also partially functioning however the component does not update and display breadcrumbs when selecting on blocks.
I think you hint at the answer in the tutorial;
Looking at the current WP implementation of EditPost they're actually embedding the whole
InterfaceSkeleton
within theBlockEditorProvider
whereas this tutorial has it outside.Any help would be really appreciated.
The text was updated successfully, but these errors were encountered: