kriegar Posted January 18, 2016 Share Posted January 18, 2016 Hi guys, I have seen this done but have no idea how to do it. I have the dashboard plugin installed and would like dashboard page to be the first page that comes up after logging in. Any ideas? Thanks Link to comment Share on other sites More sharing options...
Martijn Geerts Posted January 18, 2016 Share Posted January 18, 2016 Something like this will redirect you. (not tested) class RedirectToDashboard extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => "Redirect To Dashboard", 'version' => "0.0.1", 'summary' => "Redirect", 'autoload' => true, 'singular' => true, ); } public function init() { $this->addHookBefore("ProcessHome::execute", $this, "redirectTo"); $this->addHookBefore("ProcessPagelist::execute", $this, "redirectTo"); } public function redirectTo($event) { if (!$this->user->isSuperuser()) { $this->wire('session')->redirect('/processwire/setup/dashboard/'); } } } Link to comment Share on other sites More sharing options...
diogo Posted January 18, 2016 Share Posted January 18, 2016 I made a module for this sometime ago https://github.com/ocorreiododiogo/ProcessHomeAdmin Should still work. 1 Link to comment Share on other sites More sharing options...
Macrura Posted January 18, 2016 Share Posted January 18, 2016 Also, the module itself should handle the redirect: // Redirect calls for the admin homepage to the dashboard (first child page) if ($this->page->id == 2) { $this->session->redirect($this->page->child->url); } i usually just move the dashboard page up to the top if it isn't there after installing. you could also try posting your issue on the module's topic. Link to comment Share on other sites More sharing options...
applab Posted May 15, 2020 Share Posted May 15, 2020 On 1/18/2016 at 12:28 PM, diogo said: I made a module for this sometime ago https://github.com/ocorreiododiogo/ProcessHomeAdmin Should still work. The last time I used this module was on Dev 3.0.149 and it worked fine (in conjunction with your AdminCustomPages module). I've just installed on Dev 3.0.155 and it seems to be having no effect. Any ideas? Link to comment Share on other sites More sharing options...
diogo Posted May 15, 2020 Share Posted May 15, 2020 1 hour ago, applab said: The last time I used this module was on Dev 3.0.149 and it worked fine (in conjunction with your AdminCustomPages module). I've just installed on Dev 3.0.155 and it seems to be having no effect. Any ideas? It's working nicely for me on the newest dev version of PW. Did you change the process on the admin page from "ProcessHome" to "ProcessHomeReplace"? Link to comment Share on other sites More sharing options...
applab Posted May 15, 2020 Share Posted May 15, 2020 41 minutes ago, diogo said: It's working nicely for me on the newest dev version of PW. Did you change the process on the admin page from "ProcessHome" to "ProcessHomeReplace"? Doh!, you are indeed correct. How did I miss that in the 2 line readme! Thanks. Link to comment Share on other sites More sharing options...
diogo Posted May 15, 2020 Share Posted May 15, 2020 can happen ? you're welcome! 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