8

The dashboard widgets are currently set on a per user basis. Brandon has said on the Google+ community that a site-wide and/or user group solution is planned but doesn't have en ETA. https://plus.google.com/106689452282751248337/posts/CvZZa5DDGwb https://plus.google.com/103717873128586100650/posts/gW9buKqF4LA


8

I think you are mixing up your Primary Plugin Class with your Dashboard Widget. Plugin Structure: Assuming your plugin is called Gareth and your widget Gr, this files should be in your /craft/plugins/gareth/ directory: GarethPlugin.php templates/ GrWidget.html widgets/ Gareth_GrWidget.php Primary Plugin Class: GarethPlugin.php Your primary plugin ...


7

You can use this Control Panel JS plugin to change the info. Just copy the cpjs folder in the craft/plugins/ folder and the plugin should appear in Settings->Plugins. Install it and add your code in the textarea displayed at the bottom. Now with your title: In the dashboard, each widget has an ID like widget1, widget2, etc; get it with the dev tools. ...


4

I have developed a plugin to do this https://github.com/james1238/duplicateuserdashboard


3

Craft charts are taking the width and height of the container's <div> as a basis for drawing the chart. So your JS is probably working but you need to define a width and height for the chart's div to make it work. A basic implementation of the Area chart would look like this: {% extends "_layouts/cp" %} {% set title = "Area Chart"|t %} {% includecss ...


3

It appears when a new widget is created it has a variety of classes (such as new and loading-new) that don't exist on established widgets: class="widget new loading-new myplugin_mywidget flipped last" It's also possible to add javascript to the widget settings file that gets rendered for your widgets settings. In the admittedly lame (but illustrative) ...


3

Since the shuffled markup is the root of the problem, one might follow examples from the Craft control panel source that serialize the form's data and submit via AJAX (and often $.proxy() to help with scope). This is a lot of work, however, for minor stylistic gain. If the problem is limited to presentation, the solution should be too. @narration_sd helped ...


3

https://straightupcraft.com/craft-plugins/?q=analytics& shows some possible analytics candidates. Particularly these: https://straightupcraft.com/craft-plugins/instant-analytics https://straightupcraft.com/craft-plugins/piwik-analytics https://straightupcraft.com/craft-plugins/3redkites-piwik-analytics-for-craft-cms https://straightupcraft.com/craft-...


3

found a way to solve the problem. feels a bit 'dirty' to iterate over all active widgets to get the one i need (in the service class). the other option is craft()->dashboard->getUserWidgetById(), but how the heck can i get the id of the widget by given type in a simple way? how ever, this solution works: controller method (requested through ajax) ...


2

I have just made a plugin to do a similar thing it duplicates a selected users dashboard see https://github.com/james1238/duplicateuserdashboard


2

I'm a bit late to the party here, but for future reference you can get the widget id by looking at the data-id attribute of the widget HTML, or by using $this->model->id in the widget code.


2

I found an answer that works for me at least.. Since I render my widget via Javascript and not via PHP/Twig I can use this $(document).on("click", ".colspan-picker a", function(){ var container = $(this).parent().parent().parent(); widgetID = container.data("id"); sRGoogleAnalyticsRerenderChart(widgetID); }); .colspan-picker a is the element ...


2

as jQuery docs says you have to pass data object or string via data. so you should change var data = []; to var data = {}; in your code


1

If it were my project, I would probably put the PHP file in modules Here's some more info https://docs.craftcms.com/v3/extend/ and here: https://docs.craftcms.com/v3/extend/module-guide.html


1

Just checked 2 upgraded sites of me and to me it's working..


1

You're over-thinking it a little bit. To save your widget settings, you don't need a controller class, you only need a) a method called defineSettings() in your widget class, returning the settings you need, e.g. protected function defineSettings() { return array( 'url' => array(AttributeType::Url, 'required' => true, 'label' => 'URL'), ...


1

There’s no such thing as a “global” widget right row, however your widget’s getBodyHtml() method can return false, which tells Craft to not show the widget at all. So you could just have the widget assigned to all the user accounts you want, and always return false unless there’s actually something to display.


1

If you're looking to do it on a per-user basis, you can change what feed the widget points to by clicking the dashboard settings icon near the top of the dashboard. You can also remove the widget entirely from there as well. The settings for all widgets are json-encoded and saved in the craft_widgets table in the settings column.


Only top voted, non community-wiki answers of a minimum length are eligible