operat Posted August 30, 2016 Share Posted August 30, 2016 I wonder whether it is possible to customise the admin navigation in a way that makes it easier to distinguish one ProcessWire instance from another. What I have in mind, is a small image/icon somewhere in the top navigation bar, which visually identifies the current project (see attachment). That would help a lot! Is it possible? Link to comment Share on other sites More sharing options...
BitPoet Posted August 30, 2016 Share Posted August 30, 2016 You should be able to hook into AdminTheme::getExtraMarkup and add your image to $extras["masthead"] (untested): $wire->addHookAfter('AdminTheme::getExtraMarkup', function($event) { $extras = $event->return; $extras['masthead'] .= ' <img src="path/to/your/logo.png">'; $event->return = $extras; }); You can look into AdminThemeDefault/default.php to see where the different extras are used. 1 Link to comment Share on other sites More sharing options...
operat Posted August 30, 2016 Author Share Posted August 30, 2016 @BitPoet thanks for your quick reply! The genaral approach works, which is great! However, this hook adds the <img> as the first element in the #masthead. What I would like to achieve is, adding something like <li><img src="path/to/your/logo.png"></li> as the last element in #topnav. What needs to be changed? Link to comment Share on other sites More sharing options...
BitPoet Posted August 30, 2016 Share Posted August 30, 2016 Ah, didn't look which admin theme you're using. Hooking into AdminThemeRenoHelpers::topNavItems should be the way to go. $wire->addHookAfter('AdminThemeRenoHelpers::topNavItems', function($event) { $out = $event->return; $out .= '<li><img src="path/to/your/logo.png"></li>'; $event->return = $out; }); 2 Link to comment Share on other sites More sharing options...
operat Posted August 30, 2016 Author Share Posted August 30, 2016 Sorry, didn't mention I was using Reno. Now it works. Thank you very much! I added styling for the image with the help of the Admin Custom Files module (http://modules.processwire.com/modules/admin-custom-files/). Is there another/better/recommended way to go? 2 Link to comment Share on other sites More sharing options...
operat Posted September 28, 2016 Author Share Posted September 28, 2016 I'm still unsure, so I'd like to ask again: I added styling for the image with the help of the Admin Custom Files module (http://modules.processwire.com/modules/admin-custom-files/). Is there another/better/recommended way to go? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now