I know this is an old topic, but I just ran into this today and wanted to add an admin nav section in the minimally invasive way possible. This technique worked for me and I'm wondering if anybody has any thoughts about this being a good or bad approach to quickly adding a custom admin navigation menu from a plugin. Any critiques appreciated!
plugin/static/js/admin/custommenu.js:
var adminInitialized = false;
$(window).on('action:ajaxify.start', function(data) {
if (!adminInitialized) {
$('ul#main-menu').append('\
<li class="dropdown menu-item">\
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Custom Menu</a>\
<ul class="dropdown-menu" role="menu">\
<li><a href="/admin/my-custom-route">Custom Route</a></li>\
</ul>\
</li>');
adminInitialized = true;
}
});
plugin.json:
"acpScripts": [
"static/js/admin/custommenu.js"
]