Dashboard Widgets - disable widgets and more areas or grid layout

I would love to have some more options to customize my dashboard. It’s the first thing I see on every login and normally I skip the page completely.

The core widgets aren’t customizable. If I have more than 5 collections, the one I search for never appears on top of the widget list. The aside widgets aren’t wide enough and the main widget is too wide… When I don’t need the huge main area, half of the page is empty…

A few things, I would change (sorted by priority):

  1. disable or remove time widget (the timer doesn’t work and I really don’t need it)
  2. add a check if $widget['disabled'] == true
  • now it’s possible to deactivate widgets with a request or in the database
  1. change area sizes to 1-3 or add area, that splits main in half… or skip this point and go to point 5 - grid layout
  2. GUI to activate it again / to manage widgets
  • I’m not sure about the best place
    • /settings/widgets --> user needs settings access
    • /accounts/account --> seems to be the right place
  1. grid layout
  • move whole areas
  • move single widgets
  • resize widgets

It’s not the most important thing right now, but it would clean the dashboard and building custom widgets would be a pleasure.

@artur Do you have other plans with the dashboard?

@aalbinson Do you want to join?

@raffaelj, if you need something very custom you can always build your controller/view and reroute the dashboard page there:

$app->on('admin.init', function() {
  $this->on('admin.dashboard.widgets', function($widgets) {
    $this->reroute('/my-dashboard');
  });
});
1 Like

@pauloamgomes Thanks for the hint. I discovered another method, which doesn’t load Base.php and saves a few function calls plus the redirect:

$app->on('admin.init', function() {
    $this->bind('/', function(){
        return $this->invoke('My\\Custom\\Controller', 'index');
    });
    $this->bind('/cockpit/dashboard', function(){
        return $this->invoke('My\\Custom\\Controller', 'index');
    });
});

I thought, I can’t re-bind paths, but admin.init is triggered before modules/Cockpit/admin.php is included.

1 Like

@raffaelj yep, your approach is far better than mine :slight_smile: