Jump to content

Recommended Posts

Posted

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 :)

Posted

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/');
    }
  }
}
Posted

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.

  • 4 years later...
Posted
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?

Posted
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"?

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...