e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

Get support for using menus in menus folder #4142

Open Jimmi08 opened 4 years ago

Jimmi08 commented 4 years ago

Motivation

Menu manager already displays available menus in menus folder. For example, content plugin generates menus for Main parent categories in menus folder inside the plugin folder It is very handy when you have a complex plugin with more menus and you want to have them organized.

Proposed Solution

Add support for ability to use e_menu for menus folder (configuration).

Now it fails because path for those menus is plugin folder/menus (content/menus) and Menu manager is looking for e_menu: (e_PLUGIN.$row['menu_path']."e_menu.php")

and then

$plug = rtrim($row['menu_path'],'/');
$obj = e107::getAddon($plug,'e_menu');

If you just remove string "menus" from menu_path, it should work. Something like this: $row['menu_path'] = str_replace("menus","",$row['menu_path']);

Thanks

Jimmi08 commented 4 years ago

Related: https://github.com/e107inc/e107/issues/4056