-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation Block: Add support for a dynamic home URL #20542
Comments
Absolutely. This is also related to the tasks of removing the url attribute for site resources. |
I took a pragmatic approach to this problem in bobbingwide/fizzie#22 In my theme I've left the hardcoded string as originally coded.
|
I think we should create a special block variation of |
@priethor were you still working on this one? |
I kind of am. I expect to retake it in a few days as it's a good first issue but can of course pass it along as soon as it starts becoming a blocker. 👍 |
Sounds good @priethor 👍 Let us know if anything changes. |
Where are we with this one? |
I was exploring this last week, and my first impression is that a block variation might not be the best solution, as the block would better be a dynamic one so that the link stays in sync with the home URL whenever it's changed in the settings. Also, it would require a different workflow and state handling than normal links as it would never be empty and would not require placeholder states, for example. In any case, as the need for this feature becomes more prominent, I think it's about time for me to unassign the issue and let somebody focus on it and truly bring it forward. |
As an FYI these two landed, so another navigation link variation + some custom handling should do the trick. Folks should also be aware of the following issue in the navigation editor: |
Thanks @gwwar , those changes simplify the Home variation, indeed! 💯 |
Curious why this one needs to be a variation instead of just its own block as a wrapper for |
It's own block would work too. |
I'd say a separate block makes more sense since we don't need any of the UI to set a custom link. |
I started exploring the block variation based on previous comments on the issue, but because of not needing any of the UI, I find a separate block would keep it simpler and wouldn't violate the open-closed principle. |
@priethor was there a PR here to help review? |
There isn't, I explored the variation but didn't proceed with the new block @gwwar. It's open to being picked among the Navigation block priorities. |
Today, when you add a homepage menu item in the Navigation Block, this gets mapped directly to that page's ID & URL. For example:
This is fine for a single site, but when the navigation block is used in a theme template or template part (or even in a block pattern), we'll want a way to have a homepage link dynamically map directly to the site's homepage, via something like
home_url()
.The text was updated successfully, but these errors were encountered: