Closed ErikSwan closed 9 years ago
Thanks @ErikSwan - great idea! Hadn't actually thought of that, so nice one :)
No problem! This plugin is a must, as in my opinion the default navigation items in the CP are not very intuitive for clients, especially for simpler sites. Thanks for building it!
I've added some JavaScript and a small conditional to correct which navigation item is selected for manually added navigation items. This significantly improves the look and usability for manually added navigation items, and is especially useful if adding nav items for individual entries (a homepage, for example).
Before:
After:
The preg_replace is necessary to be able to correctly handle both absolute and relative URLs as inputted by the user.
Unfortunately this does have to be done with JavaScript injection right now as the point at which nav items are decided if they are "selected" or not happens after the modifyCpNav hook that is available to plugins.