Zeka Posted June 2, 2016 Share Posted June 2, 2016 Hi. I need to output some custom external and internal links in admin sidebar navigation menu. Is there some predefined way to do that or i have to create process module? Thanks Link to comment Share on other sites More sharing options...
tooth-paste Posted June 2, 2016 Share Posted June 2, 2016 This could work! 1 Link to comment Share on other sites More sharing options...
Robin S Posted June 3, 2016 Share Posted June 3, 2016 For static links you could use AdminCustomFiles and append the links with jQuery. Beyond that you could duplicate and rename the admin theme module and then code in whatever links you need, as I don't think the menu render function is hookable (for the default theme at least). Or a process module, as you say. Also, if by internal links you mean links to edit a particular PW page remember that you can set up page edit bookmarks. 1 Link to comment Share on other sites More sharing options...
ottogal Posted June 3, 2016 Share Posted June 3, 2016 remember that you can set up page edit bookmarks. Thank you for having brought this back in mind... Link to comment Share on other sites More sharing options...
Zeka Posted June 3, 2016 Author Share Posted June 3, 2016 Hi guys and thanks to everybody for suggestions. I should look to all of them more deeply. Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted June 3, 2016 Share Posted June 3, 2016 Another way is to insert it via JavaScript. Note, this example is tested for the default admin theme, not Reno. First place the following in your admin.php file above the require controller line, inside your templates dir: $config->scripts->append($config->urls->templates."admin.js"); Then place the following in a file called admin.js in your templates dir: $(document).ready(function(){ $('#topnav').append('<li><a href="https://example.com/" target="_blank">Example</a></li>'); }); I'm sure the jQuery could be more elegant, but the point is it can be done via JS as well, which I ended up doing for a recent project for reasons I can't remember. In my specific example, I linked it to a Google Doc which contained help documentation for a site. 2 Link to comment Share on other sites More sharing options...
Andi Posted March 4, 2019 Share Posted March 4, 2019 On 6/3/2016 at 7:25 PM, Jonathan Lahijani said: Another way is to insert it via JavaScript. In case anyone should need it, this still works with the latest UiKit Theme, just replace the jQuery selector with: $(document).ready(function(){ $('#pw-masthead .pw-primary-nav').append('<li><a href="https://example.com/" target="_blank">Example</a></li>'); }); Or @Jonathan Lahijani's recipe for a less quick & dirty approach: https://processwire-recipes.com/recipes/create-custom-admin-settings-page-link-in-admin-menu/ 1 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted March 4, 2019 Share Posted March 4, 2019 44 minutes ago, andi said: In case anyone should need it, this still works with the latest UiKit Theme, just replace the jQuery selector with: $(document).ready(function(){ $('#pw-masthead .pw-primary-nav').append('<li><a href="https://example.com/" target="_blank">Example</a></li>'); }); Or @Jonathan Lahijani's recipe for a less quick & dirty approach: https://processwire-recipes.com/recipes/create-custom-admin-settings-page-link-in-admin-menu/ Just a note, better to update the recipe code to: if($page->template=="admin" && $page->parent->id==2 && $page->name=="settings") $input->get->id = $pages->get("/settings/")->id; 1 Link to comment Share on other sites More sharing options...
cst989 Posted November 13, 2019 Share Posted November 13, 2019 On 3/4/2019 at 7:41 PM, andi said: @Jonathan Lahijani's recipe for a less quick & dirty approach: https://processwire-recipes.com/recipes/create-custom-admin-settings-page-link-in-admin-menu/ This seems like one of the nicest, cleanest methods to do this, but for me it doesn't work. I end up on this page instead The Url is /manage/settings but when I click it I'm redirected to /manage/settings/bookmarks What am I doing wrong? Link to comment Share on other sites More sharing options...
Zeka Posted November 13, 2019 Author Share Posted November 13, 2019 @cst989 The issue could be that you incorrectly set ID of a page and then you get redirect to bookmarks page. Redirect is handled here https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L77 1 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