-
Posts
6,671 -
Joined
-
Last visited
-
Days Won
366
Everything posted by bernhard
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
can you post your $pages->findObjects() call please? Sorry, missed that you already did that. You can try dumping the query that is created by my module and throw that to the dbms and analyse it. As I wrote in the related thread I'm working on another implementation of RockSqlFinder as I came across some limitations yesterday -
hey @adrian would it be hard to implement a fullscreen feature for the console panel? or maybe all panels? the resize is great, but a fullscreen would even be greater no priority at all, but if it is easy I would highly appreciate this feature ps: sometimes i have z-issues with the panel:
-
@flydev that's exactly what it is built for. I think you'll love it combined with RockGrid I worked on it quite heavily yesterday because at the moment it is not possible to query referenced page fields easily. See this example: "account" is the bank account where the transaction relates to. "account:title" should show "MyBankAccount 1" and "MyBankAccount 2" but it shows the "title" of the transaction (uniqid). I'm tackling this today, so if you have some time to wait, that might make sense. Or you might come up with a good solution for that? I thought of adding dot-notation, like "account.title.status" showing the account id, the account title and its pw-status. When I tried that, I realized that it might be better (or the only way) to JOIN all the field's tables so that they are available to query for the related information afterwards. This is not possible with the current subquery setup. The other option I will check today is to make easy JOINS possible. This might be easier. Something like this: $pages->findObjects( ['template=transaction', ['id', 'title', 'account', 'images:description'], [ 'name' => 'trans', 'joins' => ['template=account', ['id', 'title', 'status'], ['name' => 'acc', 'on' => 'acc.id = trans.account']], 'concat' => ['account', 'images'], ]] ); What do you think?
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
Thanks @szabesz and @tpr, same feeling here. I just thought there might be a processwireish-3-lines-of-code-no-dependencies-at-all solution Also thanks @jmartsch, but the last thing i want is to include any dependencies for such a small priority Thanks for your feedback. -
I'm quite sure you will Actually it's a VERY important part of my RockGrid module. This makes building Grids (or Datatables, or "Listers" how we in the PW world would call it) a breeze. You just throw a $pages->findObjects() call to the grid and let it do the rest (sorting, filtering, pagination etc). Another usecase where this can really be a lifesaver is all kinds of data exports, feed generation etc. - It makes a huge difference to load 10.000 pw pages compared to executing an SQL and a quick php foreach. I'm working on the module again because it was too limited for my needs. I think I will come up with a good solution the next days! (And proper docs)
-
If anybody of you like me totally missed the markdown preview of vscode just click the preview icon on the top right:
- 246 replies
-
- 3
-
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
Thx. But I don't want to add any dependencies if not really necessary (like RockSqlFinder) -
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
I knew you would ask Thats the screenshot tool Hm, never worked with gulp and don't think it would be worth the effort. Maybe it does not matter at all? Does anybody know of any real issues when loading a lot of files? Does anybody know at which number this "a lot" could be? I thought of a snippet that does a foreach and creates a file on the fly with file_put_contents. But the file would need to be different for all pages (thats how it works now). Hm... I could actually change that behaviour and create one single js and one single css file thats always loaded when any rockgrid item is available on the page. Since all the plugins load with eventlisteners this should work... I'll leave this on the ideas-list... -
Please see the current version of this module here: https://modules.processwire.com/modules/rock-finder/
- 37 replies
-
- 18
-
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
Question to all of you: At the moment the module loads all assets separately. Each plugin and each renderer is placed in one file. I don't want to change this, because that way it stays clean and maintainable. But I thought it might not be ideal to load all those files separately for sometimes only one line of code inside this file. Do you have any ideas how i could combine those files to one js file and one css file? ProCache could do that on the frontend, but I don't want to rely on a pro module, and it would not work in the backend. Thanks for any hints -
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
Just tested the field on a custom admin page: public function ___execute() { $form = $this->modules->get('InputfieldForm'); $f = $this->modules->get('InputfieldRockGrid'); $f->label = 'Default Report'; $f->themeBorder = 'none'; $f->setData("id>0, limit=10", [ 'title', 'templates_id', 'created', 'status', ]); $form->add($f); return $form->render(); } Thanks again @adrian for Tracy's awesome request info panel to get the proper "themeBorder" setting edit: ajax mode does not yet work in processmodules... -
Welcome to the world of ProcessWire Same feeling here for the last 4 Years Regarding your code: Maybe you need to check if the given pagename already exists. Not sure if that happens automatically or not, but you should definitely try and see if it throws an error.
-
@Artomultiplo of course everything is still working. The index.php file is the main processwire file, see https://processwire.com/api/include/ If you only want to create new pages from inside processwire (eg in a template file) you don't need to include index.php, because processwire is already booted.
-
Thx, this looks nice, but am I right that this forum is 0% responsive and also has no mobile version? All those solutions look so oldschool Even https://www.phpbb.com/community/ looks more modern... May I hear your reasons for choosing mybb over phpbb (they look quite similar)?
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
I think I'm almost done Plugins are now very easy to create and extremely useful as they are reuseable across multiple projects: Sample setup of column statistics: // custom column stats grid.plugins.colStats.valueGetters = { id: function(column, selected) { return grid.pluck(0,{selected}).length + (selected ? ' selected' : ' rows'); }, percent: function(column, selected) { return grid.avg(column, {selected}); }, }; Everything works in the backend and in the frontend, just echo the field as you would do with any other field echo $page->mygridfield Data loads blazingly fast. The 10.001 rows here load in 500ms and are automatically compressed by the server to reduce transfer time (here it results in 90KB instead of 1MB of data!). Thx again @adrian for that idea. Cell renderers can be combined as you like! That's really powerful and great! We can build libraries of different cellRenderers that we need often and then just wrap them in a function and return the one's we like: In this column I combine the "actionItems" renderer and the "percentBar" renderer. The actionItems are only applied for regular rows. For rows of the "colStats" plugin we only append " (avg)" to the cell and don't show the icons because they are here to edit this lines related page (and of course the statistics row has no related page): colDef.cellRenderer = function(params) { var str = ''; if(!params.data.colStatsRowType) { str = RockGrid.renderers.actionItems(params, [ { icon: 'fa fa-bolt', href: '/admin/page/edit/?id=' + params.data.id, target: ' target="_blank"', str: 'Open external: ' + params.data.title, },{ icon: 'fa fa-search', href: '/admin/page/edit/?field=percent&id=' + params.data.id, str: 'Open panel: ' + params.data.title, class: ' class="pw-panel hover"', }, ]); } else { str = ' (avg)' } return RockGrid.renderers.percentBar(params, str, (!params.data.colStatsRowType ? 0 : 2)); }; Updating the grid after closing the panel is on my todo-list -
Wow, collabora code looks very interesting!! Thanks for bringing this to my attention. I'm very excited about how you will integrate this with processwire!
-
why do you need that complicated setup? maybe I missed something here but why not just like this? $(document).ready(function() { var text = ProcessWire.config.demo; $("h2.tagline").addClass("color-red"); console.log(text); });
-
I have a suggestion for an "explanation" for such a client in form of an offer you could send him: Form with honeypot spam-protection: X € Form with recaptcha spam-protection: X + Y € And with the Y € we could fund the implementation of recaptcha into RockForms "Y" has to be totally overpriced, of course
-
'recipes' => [ // sample callback as recipe function() { $this->msg('Installing AOS...'); $aos = $this->installModule('AdminOnSteroids', 'https://github.com/rolandtoth/AdminOnSteroids/archive/master.zip'); $this->wire->modules->saveConfig($aos, [ 'enabled' => 1, 'enabledSubmodules' => ['FieldAndTemplateEditLinks'], ]); $tracy = $this->installModule('TracyDebugger', 'https://github.com/adrianbj/TracyDebugger/archive/master.zip'); $this->wire->modules->saveConfig($tracy, [ 'superuserForceDevelopment' => 1, 'editor' => 'vscode://file/%file:%line', ]); }, ], Current version of the kickstartfile: Installs AOS, enables it, enables editlinks. Installs TracyDebugger and sets editor protocoll handler for vscode. 1-click installation of ProcessWire with custom module setup and (in contrary to using site profiles) UP-TO-DATE modules and pw-version! Since january I have not run the default pw installer once...
-
Thanks @gebeer I took a quick look but have no time (and interest) to implement this at the moment. At least not as long as I don't have any spam issues with the existing honeypot solution. I'm happy to accept pull requests though. I've fixed a small bug and I've added automatic loading of assets while checking your request. V2 is on gitlab
-
HEEELP! This request was aborted because it appears to be forged!
bernhard replied to WireCodex's topic in General Support
I think you could open an issue at GitHub explaining your example and providing the link to the 127 entries related to that error message. Maybe Ryan has an idea how he can add some checks that show more helpful informations and make it easier to track down the issue. -
No, hidden is just hidden for find operations, but the page can still be accessed directly. You need to set it to "unpublished" (then a request leads to a 404 error not found). Then you need to add "include=all" to your $pages->find() selector otherwise it will not find your alerts.
-
that looks totally fine to me just make sure that the alert pages itself are not accessible from the frontend. maybe I'm wrong, but I guess you have some "bootstrap_alert" pages with a related bootstrap_alert.php file in the templates folder? then those pages will be accessible as /whatsoever/youralertpage1 from the frontend and that might not be what you want?
-
Hi @MikeM and welcome to the forum, your question was well structured and it seems that you put some time into writing your request. And you see that you got multiple helpful answers within a very short time period. That's how it usually works here - so if you decide to start learning pw you'll always find a helping hand here If you choose pw you should definitely take a look at my new module: You can build any form you want very easily. It's the only tool that I know that has frontend and backend validation in one go (making it super easy and fast to setup and highly maintainable) and it also has conditional fields, what you described as a must-have: https://doc.nette.org/en/2.4/form-validation There's also the pro module formbuilder, but I have only bought and never used it so I can't tell you anything about it. PS: If you need any assistance or new features for RockForms I would be happy to implement those features for you.