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

Add more options instead of url #21

Open
Neirda24 opened this issue Nov 5, 2021 · 3 comments
Open

Add more options instead of url #21

Neirda24 opened this issue Nov 5, 2021 · 3 comments

Comments

@Neirda24
Copy link

Neirda24 commented Nov 5, 2021

Hi !

Unless I'm mistaken, this plugin only allows to set a URL.
If we need one MenuItem to always point to a taxonomy, then we have to update the menu everytime we modify the slug of this taxonomy.
What would be great is to have a possibility to link to a taxonomy directly within the menu. Then either fetch the URL on render or cache it and invalidate it whenever we update the taxonomies.

What do you think ?

@jacquesbh
Copy link
Member

Hey @Neirda24!

I agree that it could be great. But for me editing the slug of a taxon should not happen :p.

Also the main idea behind the plugin is to fetch the menu and all its items in one SQL query.
If we add a way to specify a taxon as a destination we may need to run more than one SQL query.

I'm open to suggestion on how to develop this feature without killing the performance!

@Neirda24
Copy link
Author

@jacquesbh : Indeed we have to take into consideration the performances. This could be one way :
Store two menus in database : one canonical and one "compiled". The compile occurs either when we save the menu or when a taxonomy is edited. That way we always have one query to fetch the menu.

@maximehuran
Copy link
Member

For now we don't link items with entities.
See #36 to simplify the selection of the slug.
Maybe it can be done with an event on save on entities like taxon or product to check if a link exists and replace it in the menu. Or generate a redirection when a slug change.

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

No branches or pull requests

3 participants