mattmilburn / strapi-plugin-menus

A plugin for Strapi CMS to customize the structure of menus and menu items.
MIT License
111 stars 28 forks source link

Make Menu Available via Slug #163

Open derschiw opened 2 months ago

derschiw commented 2 months ago

Hey there 😊

I very much like your plugin for its simplicity. I just wondered wether it would be a possible to make the menus available via its slug. For now it is only possible to search it via id, like so:

const mainMenu = await fetch(`${API_BASE_URL}/api/menus/1?`);
const footerMenu = await fetch(`${API_BASE_URL}/api/menus/2`);

In this case it would be nice to be able to search it this way (as the menu already has a slug attribute):

const mainMenu = await fetch(`${API_BASE_URL}/api/menus/main`);
const footerMenu = await fetch(`${API_BASE_URL}/api/menus/footer`);

Not 100% necessary but would be nice to have. Thanks and bye!

ayhid commented 6 days ago

You can use filters for this