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

Dynamic menus #154

Open
kevindeyne opened this issue Jan 31, 2023 · 0 comments
Open

Dynamic menus #154

kevindeyne opened this issue Jan 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@kevindeyne
Copy link
Member

We introduce a Medusa Menu tag. This gets replaced with the known menu options. We can give it a name.

Prev impl was: <nav h:menu="top-menu"></nav>

In our controllers, we can define a @HydraMenu("top-menu"). This registers the URL to that page to the 'top-menu', regardless of where 'top-menu' will get defined.

At registration time, we need to provide Hydra with which URLs are available within our Medusa instance.

We store this in Hydra and send out an update to all attached instances of all known menu items / registered instances.

That would mean the following scenario should occur, presuming 2 medusa instances (A, B) and a hydra instance (H):

  • H is started
  • A is started, it registers with H. H update is sent out with only A's menu items. If you browse to a page with said menu, you'll see just A's menu.
  • B is started, it registers with H. H update sent out with both A and B's menu items. If you browse to a page with said menu, you'll see both A and B's menu items.
  • We bring A down. H update sent out with only B menu items. If you browse to a page with said menu, you'll see just B's menu.
@kevindeyne kevindeyne added the enhancement New feature or request label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant