Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove unwanted panels from SilverStripe Dashboard Module

Tags:

silverstripe

I'm using the dashboard module but don't want my users to be able to select any kind of panel. Is there a way to remove panels like "Weather" or "Google Analytics" from the available panels list without deleting the whole class?

like image 488
csy_dot_io Avatar asked Nov 23 '25 08:11

csy_dot_io


1 Answers

Not a real solution, more a workaround. But it does what it should.

  $("[data-create-url*='DashboardRSSFeedPanel'], [data-create-url*='DashboardGoogleAnalyticsPanel'], [data-create-url*='DashboardGridFieldPanel'], [data-create-url*='DashboardModelAdminPanel'], [data-create-url*='DashboardSectionEditorPanel'], [data-create-url*='DashboardWeatherPanel'], [data-create-url*='DashboardRecentEditsPanel']").entwine({
    onmatch: function() {
      $(this).remove();
      $('.available-panel').removeClass('even');
      $('.available-panel').removeClass('odd');
      $('.available-panel:even').addClass('odd');
      $('.available-panel:odd').addClass('even');
    }
  });
like image 125
csy_dot_io Avatar answered Nov 24 '25 21:11

csy_dot_io



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!