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

Automatically inject My Courses and Courses pages into menu on plugin activation #7386

Open
merkushin opened this issue Dec 14, 2023 · 7 comments
Labels
[Pri] Normal Can wait for the next release [Type] Enhancement

Comments

@merkushin
Copy link
Member

merkushin commented Dec 14, 2023

Is your feature request related to a problem? Please describe

When we use a block theme, the pages are not added to the main menu automatically.
So when the user completed all the tasks that we suggested in the onboarding flow and went to the frontend, they might be surprised and frustrated.

Describe the solution you'd like

I propose to add a task to add Sensei pages to the main menu in the onboarding checklist.
See #7386 (comment).

@donnapep
Copy link
Collaborator

donnapep commented Dec 15, 2023

I think we can use Block Hooks to add the pages automatically to the menu for the user so they don't need to do it manually. See woocommerce/woocommerce-blocks#11745 for an example of how Woo did it. They've limited it to just the TT4 theme, apparently due to limitations of the Block Hooks API. If we need to limit support as well for technical reasons, we should start by adding support for the Course theme.

@donnapep donnapep changed the title Remind the user to add Sensei pages in the main menu Automatically inject My Courses and Courses pages into menu on plugin activation Jan 5, 2024
@donnapep donnapep added the [Pri] Normal Can wait for the next release label Jan 5, 2024
@donnapep
Copy link
Collaborator

Related:

@m1r0
Copy link
Member

m1r0 commented Jan 17, 2024

There are currently 2 blockers for implementing this with Block Hooks.

  1. There is no way to set block attributes with the Block Hooks API. This prevents us from using the Page Link block. Here's the quote from the docs:

There is no way to set the attributes of the hooked block, so only the default instance of the block is inserted. Future improvements to Block Hooks will likely account for this limitation and others, providing a robust way for developers to extend Block Themes.

  1. Inserting child blocks into the Navigation block is not working currently. This most likely will be fixed in 6.5 as mentioned here.

We would have to wait a bit until those are resolved.

@donnapep
Copy link
Collaborator

donnapep commented Jan 31, 2024

There was work done in WordPress/gutenberg#57754 that should enable us to add Sensei pages into the Navigation block. It's scheduled to ship in Gutenberg 17.6.

@ockham
Copy link

ockham commented Feb 5, 2024

There are currently 2 blockers for implementing this with Block Hooks.

  1. There is no way to set block attributes with the Block Hooks API. This prevents us from using the Page Link block. Here's the quote from the docs: [...]

👋 This is now fixed by WordPress/wordpress-develop#5835, which will be part of WP 6.5 😊

@donnapep
Copy link
Collaborator

donnapep commented Feb 5, 2024

per0F9-1sT-p2

@m1r0
Copy link
Member

m1r0 commented Mar 4, 2024

Inserting child blocks into the Navigation block is not working currently. This most likely will be fixed in 6.5 as mentioned here.

It's confirmed that in 6.5 it's possible to add child blocks into the Navigation block:

Additionally, it is now possible to inject hooked blocks into the Navigation block. Previously, a hooked block could only be added before or after the Navigation block, but now it can also be added as its first or last child.

I'm guessing that this could now be tested on the latest 6.5 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Pri] Normal Can wait for the next release [Type] Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants