Skip to content
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

PluginSidebar is not working in FSE environment #42560

Closed
wpsoul opened this issue Jul 20, 2022 · 5 comments
Closed

PluginSidebar is not working in FSE environment #42560

wpsoul opened this issue Jul 20, 2022 · 5 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Developer Documentation Documentation for developers [Type] Question Questions about the design or development of the editor.

Comments

@wpsoul
Copy link

wpsoul commented Jul 20, 2022

Description

I believe that Sidebar plugin should work on all Gutenberg pages, but currently it's working only on post types.

In the same time, I didn't find any documentation how to add plugins to FSE pages.

Step-by-step reproduction instructions

  1. Use Sidebar plugin in plugin or theme
  2. Open Appearance - Site editor
  3. There are no new plugins or icons in the top toolbar

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@carolinan carolinan added the [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") label Jul 21, 2022
@t-hamano
Copy link
Contributor

If used on full site editing, PluginSidebar must be imported from another package.

import { PluginSidebar } from '@wordpress/edit-post';
// to...
import { PluginSidebar } from '@wordpress/edit-site';

#34460 is the PR for this.

However, it isn't mentioned in the documentation and may be worth improving:
https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/slotfills/plugin-sidebar.md#example

This is also true for other plugin support documentation.

@t-hamano t-hamano added the [Type] Developer Documentation Documentation for developers label Jul 21, 2022
@wpsoul
Copy link
Author

wpsoul commented Jul 21, 2022

If used on full site editing, PluginSidebar must be imported from another package.

import { PluginSidebar } from '@wordpress/edit-post';
// to...
import { PluginSidebar } from '@wordpress/edit-site';

Unfortunately, it's not working for me. console.log shows me PluginSidebar in wp.editSite, but when I import it, it's undefined. Also, it's still not allowing me to modify iframe elements because script is posted outside iframe and there is no hook to add it in iframe of FSE.

@t-hamano
Copy link
Contributor

but when I import it, it's undefined.

Did you add wp-edit-site as a dependency?
It worked correctly in my environment.

it's still not allowing me to modify iframe elements because script is posted outside iframe and there is no hook to add it in iframe of FSE.

As this is a separate issue from this issue, please refer to the following issue.

@t-hamano t-hamano added the [Type] Question Questions about the design or development of the editor. label Jul 22, 2022
@wpsoul
Copy link
Author

wpsoul commented Jul 22, 2022

Did you add wp-edit-site as a dependency?

You are a hero. Yes, now, it's working correctly.

It's bad that question from February about scripts in iframe was not resolved.

@t-hamano
Copy link
Contributor

I am glad to hear that the problem has been resolved.

It's bad that question from February about scripts in iframe was not resolved.

Each contributor may have a huge task at hand and may not be able to respond immediately.
However, additional discussion and PR are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Developer Documentation Documentation for developers [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

3 participants