Jump to content

Recommended Posts

Hi @d'Hinnisdaël I'm using the module in all my projects now, very well done. Just one issue or something I missed to configure, when I'm using the template panel in which I need to create some pages based on buttons action I got PW fatar error class Page not found.

Share this post


Link to post
Share on other sites
8 minutes ago, Sevarf2 said:

Hi @d'Hinnisdaël I'm using the module in all my projects now, very well done. Just one issue or something I missed to configure, when I'm using the template panel in which I need to create some pages based on buttons action I got PW fatar error class Page not found.

Not sure what you're running into here. If you have a repo or gist with the code that's blowing up, I'm happy to take a look. Best bet is to make sure your templates are properly namespaced (ProcessWire).

Share this post


Link to post
Share on other sites

It's just a simple page creation
 

$mainNode     = $pages->get(1030);
$today             = date("Ymd");
$checkToday = $pages->get("name=$today");
if( !$checkToday->id ){
    
    $td                    = new Page();
    $td->parent     = $mainNode;
    $td->template  = $templates->get("day");
    $td->title          = $today;
    $td->save();
    
}

 


and in my admin I call the panel which is that code
It's a fresh PW install 3.0.148

	wire()->addHookAfter('Dashboard::getPanels', function ($event) {
    
    $panels = $event->return;
	    $panels->add([
        'panel' => 'template',
        'title' => 'Excel import',
        'size'  => 'full',
        'icon'  => 'upload',
        'data' => [
            'template' => 'dashboard/dashb_import.php'
        ]
    ]);
 
	    
});
	

Share this post


Link to post
Share on other sites

@Sevarf2 How do you manage state in your template — get variables?

The template panel works best for displaying static data. For creating pages and importing data I'd suggest creating a custom panel type. That'd make it much easier to manage the required multi-step processes. Or better yet, a Process module for importing data and a separate dashboard panel that only kicks off the import and hands off the actual workload to the main module.

  • Like 1

Share this post


Link to post
Share on other sites
51 minutes ago, apeisa said:

Just noticed that module documentation returns 404 https://philippdaun.github.io/processwire-dashboard/

You're right, thanks for letting me know. Links should be fixed now. I just switched to a different GitHub username and hadn't come around to updating the links yet.

The docs can be found here now: daun.github.io/processwire-dashboard/

  • Like 4

Share this post


Link to post
Share on other sites

Thanks @d'Hinnisdaël

Gotta say I really like this module, solid work & documentation.

One suggestion - not sure I understand the reason for current Collection pagination? It only shows the count of results, instead of showing actual pager. Changing this to actual pager is trivial, but probably something you would like to offer as an option?

$pagination = sprintf(
  $this->_('Showing %d of %d'),
  $this->collection->count,
  $this->collection->getTotal()
);
$footer .= "<div>{$pagination}</div>";

so instead of that just use:

$footer .= "<div>{$this->collection->renderPager()}</div>";

And we have default PW pager working as expected. Of course this is not fully functional (and probably reason why left out from initial version?) is that it doesn't work with current table sorts which are only client sorts.

Another route for case where you really need paging would be using pagelist, but there I think pager limit should be a setting too.

Share this post


Link to post
Share on other sites
23 hours ago, apeisa said:

One suggestion - not sure I understand the reason for current Collection pagination? It only shows the count of results, instead of showing actual pager. Changing this to actual pager is trivial, but probably something you would like to offer as an option?

There's really two reasons this isn't implemented:

1 — I don't think it's all that necessary. For actual browsing of data that requires state and pagination, there's much better tools available: PageList and PageLister, among others. The pagination info, as implemented currently, is merely meant to communicate that there's more results than currently shown and avoid any confusion there.

2 — It's probably not that trivial to build. The native pagination breaks down once you do any sorting or render multiple paginated panels on a dashboard. To make it work well, it would have to be a custom-built solution that fetches results via AJAX and does the sorting server-side.

I'm not currently doing any substantial work on the module, however I'm planning to implement some missing features when I find the time later this summer. In the meantime, I'll happily accept pull requests for a working pagination feature.

  • Like 2

Share this post


Link to post
Share on other sites

Yes, I think you are probably right with both of your reasons. I did try to make pagelist work with pagination (it does, but couldn't get limit to be set dynamically, so it follows whatever is set on pagelist module which defaults to 50). It seems that I wont need pagination at all on dashboard (more proof for your point 1), but if the need arises I will definitely take a closer look into it.

Share this post


Link to post
Share on other sites

Release 0.7.0 adds a few features and fixes an issue reported by @MoritzLost.

  • Collection panel: Field names as column headers
    The collections panel now uses the field label as column header. No need to pass them in explicitly anymore. See the docs on column headers for details.
  • Shortcuts panel: Add option to hide shortcut summaries
    Disable the summaries altogether by setting the summaries option to false.
  • Shortcuts panel: Fix undefined-index error when destructuring shortcuts
  • Like 4

Share this post


Link to post
Share on other sites
On 8/2/2020 at 2:26 PM, d'Hinnisdaël said:

Release 0.7.0 adds a few features and fixes an issue reported by @MoritzLost.

I have a problem with the new version, each time I open the dashboard, I get 2 messages:

1525728519_2020-08-0510_07_04-Dashboard.png.b5924f8bee4ef9ab2edb8fd2f5c9c5b5.png

If the message is closed, it will be displayed again the next time the dashboard is opened.

Share this post


Link to post
Share on other sites
13 minutes ago, zoeck said:

I have a problem with the new version, each time I open the dashboard, I get 2 messages

Right, thanks, I left a session message in there. I pushed a patch at version 0.7.1. While it propagates to the module directory, removing line 119 of DashboardPanelCollection.module should work as well.

  • Like 1

Share this post


Link to post
Share on other sites
43 minutes ago, d'Hinnisdaël said:

Right, thanks, I left a session message in there. I pushed a patch at version 0.7.1. While it propagates to the module directory, removing line 119 of DashboardPanelCollection.module should work as well.

That's it, thank you very much! 🙂 

Share this post


Link to post
Share on other sites

@d'Hinnisdael : Thks a lot for the module. It's a real saving grace and makes it a breeze to present good looking admin dashboard. And the documentation is very well done too.

Thanks again for all the good work.

Share this post


Link to post
Share on other sites

Hi,

I have a question, can't get to pass option to a chart panel.

Whatever option are not getting apply. must be a synthax probleme maybe.

Here is the code. for instance with this code the legend is still below the doughnut (it should be rigth to it) and the dougnut is fairly thin and it should be 50%.

Thanks for your help.

 

$panels->add(
['panel' => 'chart',
	 'title' => 'Tags Status',
		 'data' => [
		    'chart' => [
		      	'type' => 'doughnut',
		      	'data' => [
		      		'labels' => ['Doc without tag','Doc not reviewed','Docs tags OK'],
		        
		        	'datasets' => [
		            	[
		            	'data' => [$noTag, $TagNotReviewed, $TagReviewed]
				    ]
			    ],
			    'options' => [
			    	'cutoutPercentage' => '50',
			    	'position' => 'right',			
				]
     	    ]
     	]
	]
]
);

 

Share this post


Link to post
Share on other sites
14 hours ago, antpre said:

I have a question, can't get to pass option to a chart panel.

The code looks right to me. The fact that you're seeing a chart at all means there's probably something off in the way your options are structured. The panel itself only sets the defaults so overriding them like you're doing it should work. I'm afraid I won't be of much help here since debugging Chart.js config is a bit out of scope of this module 👽

Share this post


Link to post
Share on other sites

The module seems stable enough to bump to version 1.0.

Notable changes

  • Declare a private namespace, solving install issues
  • Require the latest ProcessWire master version 3.0.165
  • Add a new panel type Add New Page which recreates the core add-page shortcut menu
  • Like 6

Share this post


Link to post
Share on other sites

@d'Hinnisdaël I'm having some trouble with a Collection panel that lists user accounts. Specifically, with the "edit" action, which appears disabled for everyone but superusers. I checked the source code, apparently the edit action is disabled on DashboardPanelCollection.module#L327. $page->editable apparently returns false if the $page is a user, even for users with the user-admin permission. Probably because editing users is a special case?

Anyway, changing this to a hardcoded false fixes the problem in my case. Of course this isn't a general solution. Maybe the module could check for this special case and only disable the edit action if the current user doesn't have the user-admin permission? Not sure what the best solution is, does anybody know why $user->editable returns false even if the current user has the user-admin permission?

Thanks!

Share this post


Link to post
Share on other sites

@schwarzdesign Thanks for reporting. I'm afraid there's no easy solution without changing how the core handles user edit permissions. Currently, the editable() check fails for all processes other than the default page-edit or page-lister ones. That's why it doesn't work in the context of the Dashboard process. See the corresponding source code of PagePermissions.module.

I'm not sure why it's done this way and if there's a chance to get this opened up. I'd suggest you open an issue in the official ProcessWire repo to get a discussion started.

Checking for user-admin permissions as a special case sounds good but won't solve the problem: the user permissions are a lot more complex when you're handling superusers vs. non-superusers and multi-layer permission systems. There's user-admin-all and any combination of user-admin-[role] permissions we'd have to check manually. It's definitely better than the current state, though. I might implement this in the near future.

  • Thanks 1

Share this post


Link to post
Share on other sites

@d'Hinnisdaël Thanks for the reply! I've opened issue #1322 regarding the context-dependence of $user->editable. Hopefully something will come of it.

I also found issue #538, which seems to be related to this? Not sure. Regardless, the fact that $user->editable returns different results based on context is troublesome in any case, so I think you're right that this should be fixed in the core.

Share this post


Link to post
Share on other sites

Nice module which I use on a couple of sites. Just wondering if it is possible to specify a group to be shown in a tab?

Share this post


Link to post
Share on other sites
1 hour ago, MarkE said:

Nice module which I use on a couple of sites. Just wondering if it is possible to specify a group to be shown in a tab?

There's currently no way of grouping panels in tabs. What'd be your use case?

Share this post


Link to post
Share on other sites

Just that one of my dashboards is getting a bit large. I'd like to have maybe 3 tabs - one a pure dashboard of information, one with various settings and one webmaster-only board with system information and housekeeping etc. I could do it with a custom module, but I like your dashboard for the information view 😉

Share this post


Link to post
Share on other sites

Maybe I'm trying to push this module too far. I decided to separate the other info into a separate (tabbed presentation) module.

Now I have a different need - to use a callback function in chart options. I can't see how to do that in the syntax, but maybe it's just not possible?

Share this post


Link to post
Share on other sites

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.

  • Similar Content

    • By jploch
      Hey folks,
      for a module (a pagebuilder based on PageTable) I need to save some settings as JSON. The values are saved for each page table item (a pw page). It's working well, but I am looking for ways to improve the structure I have. As I'm not that experienced with JSON, maybe someone more experienced can take a look and tell me if my approach is good practice. 

      My goal is to make all the items accessible by page id, without looping over them (using objects instead of arrays):
      // access from template with pw page var $jsonObject->items->{$page}->cssClass; Her is an example of my JSON structure:
      { "items": { "3252": { "id": "3252", "cssClass": "pgrid-main", "breakpoints": { "base": { "css": { "grid-column-end": "auto", "grid-row-end": "auto", "grid-column-start": "auto", "grid-row-start": "auto", "align-self": "auto", "z-index": "auto", "padding-left": "60px", "padding-right": "60px", "padding-top": "60px", "padding-bottom": "60px", "background-color": "rgb(255, 255, 255)", "color": "rgb(0, 0, 0)" }, "size": "@media (min-width: 576px)", "name": "base" } } }, "3686": { "id": "3686", "cssClass": "test_global", "breakpoints": { "base": { "css": { "grid-column-end": "-1", "grid-row-end": "span 1", "grid-column-start": "1", "grid-row-start": "auto", "align-self": "auto", "z-index": "auto", "padding-left": "0px", "padding-right": "0px", "padding-top": "0px", "padding-bottom": "0px", "background-color": "rgba(0, 0, 0, 0)", "color": "rgb(0, 0, 0)" }, "size": "@media (min-width: 576px)", "name": "base" } } }, "3687": { "id": "3687", "cssClass": "block_editor-3687", "breakpoints": { "base": { "css": { "grid-column-end": "span 2", "grid-row-end": "span 1", "grid-column-start": "auto", "grid-row-start": "auto", "align-self": "auto", "z-index": "auto", "padding-left": "0px", "padding-right": "0px", "padding-top": "0px", "padding-bottom": "0px", "background-color": "rgba(0, 0, 0, 0)", "color": "rgb(0, 0, 0)" }, "size": "@media (min-width: 576px)", "name": "base" } } }, "3696": { "id": "3696", "cssClass": "block_editor-3696", "breakpoints": { "base": { "css": { "grid-column-end": "span 2", "grid-row-end": "span 1", "grid-column-start": "auto", "grid-row-start": "auto", "align-self": "auto", "z-index": "auto", "padding-left": "0px", "padding-right": "0px", "padding-top": "0px", "padding-bottom": "0px", "background-color": "rgba(0, 0, 0, 0)", "color": "rgb(0, 0, 0)" }, "size": "@media (min-width: 576px)", "name": "base" } } } }, "breakpointActive": "base", "breakpointActiveSize": "@media (min-width: 576px)" }  
    • By jploch
      Fieldtype Page Table Grid
      This is a sneak preview of a side project I've been working on for quite some time now. A lot of work and thought has gone into this, so I will most likely release this as a commercial module at some point in the near future. 

      As a designer (and developer) I get the appeal of a WYSIWYG editor. After playing around with some WYSIWYG page builder tools, I always felt something was wrong about them. So I decided to build my own PW version based on PageTable.

      Here is a small demo (using AdminThemeCanvas, but its working with other admin themes as well) :
      There is also a complete website that I built for a friend of mine using this module and some custom blocks.
      Concept
      This fieldtype shares a lot of features with PageTableExtended: it's also an extension of PageTable and renders the block templates in the backend and frontend (native PW templates and fields). You can also add your own css via module settings.
      The difference is, this fieldtype also gives you the ability to rearrange and resize elements in a visual way as well as enable inline editing for text, ckeditor and file fields. Similar (and promising) attempts have been made, but I wanted something based on native CSS grid instead of a CSS framework...so I built my own version. Most CSS frameworks are based on flexbox, which is great for layouting elements horizontally. With CSS grid, you can place elements horizontally and vertically, allowing for layouts that were not previously possible with CSS. Similar to webflow, this fieldtype uses javascript (in the backend) to let you manipulate CSS grid in a visual way to design fully responsive websites (or parts of them). It should still be possible to include a CSS framework if you like (just add the classes to your block markup and include the CSS via module settings).
      The CSS grid layout manipulations are saved in a single field as a JSON array and used to generate a dynamic stylesheet that you simply include in your main template (no inline styles). The styles are saved within the breakpoint you select and cascade down to smaller breakpoints. That means you can specify just the basic breakpoint and adjust other breakpoints if needed. The exception is the mobile breakpoint which will display everything in one column as a default (you can change the layout here too).
      The fieldtype also comes with an optional style panel to manipulate some additional CSS properties directly on the page. You can customize the panel or disable it completely from the module settings (and just use a CSS file that you include via module settings). The style panel is based on inputfields (nothing is saved to the database). This means that you just have to install the module and all fields are available to all blocks automatically (this can be customized). It also has the benefit that your installation is not flooded with fields; this module only installs one field.
      Don't want to give your customer all that power? Design features can be disabled for certain roles. The grid editor role can just edit the content and use the inline editing feature to edit content quickly. You can then also grant access individually to the style panel, resize or drag functionality.
      Features
      Blocks are just pages Blocks are defined by native PW templates and fields Manipulate CSS grid in a visual way to design fully responsive websites (or parts of them) Design features can be disabled for certain roles Inline editing of text, ckeditor and file fields The layout is 100% CSS grid (very small css file size) Simply drag and resize to manipulate grid items directly inside the backend Manipulate grid columns and rows directly on the page (use any number of columns you want) All style manipulations are saved as JSON and used to generate a dynamic stylesheet that you just include in your main template (no inline styles) Nested groups/grids (child pages of nested blocks are created under group parent) Global blocks work with page reference field (changes on one page, changes all blocks on all pages) Manual and auto placement of grid items Define custom icons for your blocks via native template settings (template -> advanced -> icon) Option to load lazysizes in the backend to enable lazy loading of assets with class lazyload Works with all default and ui-kit based admin themes If you have any questions or feedback, let me know.
    • By bernhard
      I built this module because I needed a versatile solution to replace tags and simple if-blocks in some E-Mails and PDF documents.
      If you only need to replace static tags (no if-conditions), then you can use default PW api and need no module:
      $str = "My favourite color is {color}."; $texttools = $sanitizer->getTextTools(); echo $texttools->populatePlaceholders($str, ['color' => 'red']); // output: My favourite color is red. Usage:
      See the two example Files in the folder /replacements

       
      Methods:
      replacementsTable()
      Renders an overview of all available replacements (see the example in the Module's config file:
       
      Create new Replacements:
      Simply copy the sample file and adopt to your needs.
       
      Download:
      https://gitlab.com/baumrock/RockReplacer
    • By bernhard
      DEPRECATED
      I'm using this module in several projects, but it will likely not see any updates in the future. I'm not happy with it and I'm looking for ways to develop better solutions. RockTabulator was my first try, but I'm also not 100% happy with that. The tabulator library is great, but my module implementation is not. I hope to get a good solution soon, but it will be a lot of work...
      ---
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/FieldtypeRockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
      German Translation File: site--modules--fieldtyperockgrid--fieldtyperockgrid-module-php.json
      Changelog: https://gitlab.com/baumrock/FieldtypeRockGrid/raw/master/changelog.md
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support (please contact me via PM).
       
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module:

    • By Paul Greinke
      Hi there. I wrote a custom module for one of my projects. In fact I maybe want to use my module in other projects too. In order to be variable and customizable  I need to implement some custom hooks into my module. So I can afterwards hook into the my functions in order to modify them to match the needs of the new project.
      I tried simply defining functions with the '__' prefix. But that did not work. I'm imagining something like the following:
      <?php class MyClass { public function ___someFunction() { // Do something } } // ready.php $this->addHookBefore('MyClass::someFunction', function($event) { // some customization }); Is there a way to accomplish that? 
×
×
  • Create New...