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

[#495] Setting up a default Navigation #556

Merged
merged 9 commits into from
Mar 6, 2024
Merged

Conversation

nathan-schmidt-viget
Copy link
Contributor

@nathan-schmidt-viget nathan-schmidt-viget commented Mar 1, 2024

Summary

The option to render inner blocks inside of core/navigation will be in WP version 6.5. So this is a workaround for now. See the notes in the ticket for more details #495.

This updates the wp_navigation content with the two About and Auctions page using <!-- wp:navigation-link -->. This allows us (and the user) to have full control of the navigation block in Gutenberg.

  • Updates the options with the About and Auction page id on site creation.
  • Navigation runs on Site verification.
  • Updates the navigation content.

Things still TODO:

  • Figure out why it does not fire on setup.
  • Figure out how to get nav ID - it is always the first one.

Issues

Testing Instructions

  1. Set up a new site and fill out all the information to verify the site.
  2. Go to the front-end of the site and make sure the navigation is updated.
  3. Edit the navigation and make sure you can add more or update the current links.

Screenshots

Front-end

Screenshot 2024-03-01 at 3 56 52 PM

Admin

Screenshot 2024-03-01 at 3 57 33 PM

@clatwell
Copy link
Contributor

clatwell commented Mar 4, 2024

All in the same hook where the pages get created, trying to figure out a different place to do it.

Copy link
Contributor

@joshuapease joshuapease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@joshuapease
Copy link
Contributor

Is this still a draft?

@nathan-schmidt-viget
Copy link
Contributor Author

Yep it is still a draft. Once we get the hook added for creating site we will update this PR so the nav get created on that hook.

@bd-viget
Copy link
Contributor

bd-viget commented Mar 5, 2024

@nathan-schmidt-viget This should be good to go. Give this a test and let me know if it's working. The Navigation will be updated when the Site is verified (not initialized, that hook is too early).

@clatwell clatwell mentioned this pull request Mar 5, 2024
9 tasks
* [#495] Setting up basic test with nav links

* [#495] testing out pattern for custom menu

* [#495] pulling in the created pages into the new nav

* [#495] adding notes for TODO

* [#495] getting active nav post id

* [#495] A couple of tweaks, potential bug fixes

* [#495] Some fixes/adjustments

* [#495] Used Verified hook for Navigation Changes

* [#495] Fix nav + other bug fixes

---------

Co-authored-by: Nathan Schmidt <[email protected]>
@nathan-schmidt-viget nathan-schmidt-viget marked this pull request as ready for review March 6, 2024 14:17
Copy link
Contributor

@bd-viget bd-viget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🚀

@nathan-schmidt-viget nathan-schmidt-viget merged commit 6a0f00f into main Mar 6, 2024
1 check passed
@nathan-schmidt-viget nathan-schmidt-viget deleted the ns/495-init-nav branch March 6, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants