Jump to content

Jens Martsch - dotnetic

  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Jens Martsch - dotnetic

  1. Hey @gerritvanaaken, did you come up with a solution yet? I want to accomplish exactly the same, and this is how I implemented it: It's a Page Reference field, displayed as checkboxes. Now I try to use a similar code like @MoritzLost posted above, in my Smarty template.
  2. Yes it is good and in use on the site https://www.p-jentschura.com/ I added this directly in the HTML so it has nothing to do with ProcessWire in general, but I am thinking about developing a module for it to set the options. But thats only for the far future and next website project.
  3. It would also be nice, if I could add panels as an array of arrays (or objects) like $panels->add([ [ 'panel' => 'number', 'title' => 'Neue Seiten', 'data' => [ 'number' => 484, 'detail' => '100 mehr als im vorigen Monat', 'trend' => 'up', ] ], [ 'panel' => 'page-list', 'title' => 'zuletzt bearbeitete Seiten', 'data' => [ 'collection' => 'template=basic-page, limit=10', 'sortable' => true, ], ] ]); Right now, it seems, that I have to use $panels->add for every single panel, is that correct?
  4. Anyways, this is a really nice module. Thank you for releasing it.
  5. It would also be nice, if you provide a complete copy and paste solution for the admin.php, so one could directly see a working example. This requires of course to install all submodules.
  6. I found the solution, I have to include the hook before the require in admin.php
  7. I just installed the latest release from github and get the same "Your dashboard is empty" error as zoeck I have not installed multilanguage and it is a fresh install of the latest ProcessWire 1.0.148 To site/template/admin.php I added after the require $config->paths->adminTemplates . 'controller.php'; wire()->addHookAfter('Dashboard::getPanels', function ($event) { /* Get list of panels */ $panels = $event->return; /* Add panels */ $panels->add([ 'panel' => 'collection', 'title' => 'News items', 'data' => [ 'collection' => 'template=basic-page, limit=10', 'sortable' => true, ], ]); }); but the "Your dashboard is empty" message still appears. I did not set the dashboard as the entry point.
  8. 1: I don't know the answer to this, maybe the icon appears if you enable trash for non-superusers (see point 3) 2: Take a look at 3 3: Please take https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#trash-for-all
  9. Hey guys I wanted to share this little snippet with you, which can be run as a .bat file, and backups all of your databases into a separate file: K:\laragon\bin\mysql\mysql-5.7.19-winx64\bin\mysql.exe -uroot -s -N -e "SHOW DATABASES" | for /F "usebackq" %%D in (`findstr /V "information_schema performance_schema"`) do K:\laragon\bin\mysql\mysql-5.7.19-winx64\bin\mysqldump.exe %%D -uroot > P:\htdocs\database-backups\%%D.sql of course you have to change the paths to your mysql/mysqldump.exe files and the destination directory, and the username, if you have to provide another than root. This task can be executed daily via task scheduling in Windows.
  10. @teppo for front-end uploads you could also take a look at this example which utilizes TusPHP (resumable uploads) and Uppy (a nice uploader widget)
  11. Note for PHPStorm users: In my case the AutoTemplateStubs directory was automatically marked as excluded (don't know from which setting this comes from) and I had to mark the directory as "not excluded" to make autocompletition work.
  12. If you don't need to support old browsers like IE, than it is also better to use "let" to define javascript variables.
  13. As the content of the panel is a totally different document (Iframe), than in the opening document your function has to be modified. $('.DeleteDiscountButton').on('click', function(e) { e.preventDefault(); var a_href = $(this).attr('href'); ProcessWire.confirm( discountActionStrings.confirm_delete_discount, function() { // dialogue OK click window.parent.document.location.href = a_href; } ); }); The key is using window.parent.document, which refers to the document that opened the panel.
  14. I would go with Smarty or Twig. Used both. Smarty allows to use PHP functions in it's template strings, Twig does not (only with custom extensions), and Twig throws errors if something is not programmed 100% clean. That nagged me about it, also disliked the double delimiters. In terms of speed Twig and Smarty are almost even, sometimes Smarty is quicker, sometimes Twig.
  15. I can only repeat what @bernhard said. For me the admin area is outdated and does not feel fast enough. However you are free to create an own custom admin area (not only theme, but you could do it as a vuejs application). One bottleneck is the PageFinder which is very slow compared to Laravel or RockFinder, as it fetches many relations for each page. RockTabulator in conjunction with RockFinder is better for some sort of listings than ListerPro but requires more initial work, and has not all the filter possibilities that ListerPro has. I think ListerPro would be a good match for you. I built some applications where I use both RockTabulator AND ListerPro, for different tasks/views. One disadvantage of ListerPro is, that you can't use it on custom module pages, but you can do it with RockTabulator. One superior feature of the PW admin is the conditional dependency of fields (show field only if value x is in another field), which I haven't seen in other tools yet, or not yet to that extend. Regarding your original question: It is possible with PW, and it might be the perfect fit for this type of application, but only if you use the right tools/modules. Else I would look into Laravel in conjunction with AdminLTE or Laravel Nova, but thats just my preference.
  16. I created an issue on github for this https://github.com/processwire/processwire-issues/issues/1058
  17. As another alternative to the find command, you could use @bernhard's RockFinder, which is much more performant than PW's PageFinder, as it only queries the fields you need.
  18. The workflow could be like this: Add new language -> List of predefined languages with ISO code is provided, and a "Language not in this list? Add a custom language" option. So modules could use automatic translations for all predefined languages and for the custom language you could import the language file by hand.
  19. Not "exactly", as I added a slug/url field your proposed solution 😉 So we are thinking the same, and we should add a request for this, but it is a breaking change to the core. Not sure if Ryan is willing to do this. Or he/we finds a way to be backwards compatible, where the language name is different than the ISO code. The PR that @LostKobrakai provided is a bit different to this behaviour, as it would require users to import the translations by hand. The new solution could load the translations automatically, as the language code is predefined.
  20. I am thinking of something like this: language name: predefined by ISO 3166 language title: user can chooose language url: user can choose, fallback to ISO 3166
  21. Yes, you guys are right. But the "best way" would be if PW natively had support for this, regardless of what the user has chosen as the language title. The language name should be the defined value from the ISO 3166 standard, although one should be able to change the URL of the language, so instead of "de" the URL "deutsch" could be used. EDIT: This would enable us module devs to deliver language files with our modules, regardless of the users language setup.
  22. I read your first post again. So you want to load the correct country list file based on the current PW language in the admin, right? Well, this is really easy: Setup your languages with the two letter language code as the name, and as the title enter the name of the language in spoken words: Then in your module's init function enter this to get the correct file and store it in an array (example based on umpirsky/country-list): $this->lang = $this->user->language->name; if ($this->lang == "default") $this->lang = "de"; // then you can load the file from your country list into an array $this->laender = require wire()->config->paths->root . "vendor/umpirsky/country-list/data/$lang/country.php"; No there isn't a way. This was filed as an issue before, and I would also like to see this functionality in the future. I am the maintainer of the german language file, and would not recommend to do it this way. Because a language pack should not contain translations for a custom module. Else a maintainer would have to update/merge the files continously if a module author changes anything. The best way would be if PW natively had support for module language files. I think we should talk to @ryan about this, and propose a request in the processwire-request repo.
  23. Hi Martin, in one project I use https://github.com/umpirsky/country-list which provides list of countries and their ISO codes in many formats like JSON, PHP array, CSV, etc. It is installable via composer. Cheers Jens
  24. Where are you entering the URL? Do you enter it in a CKEditor field, or is it a separate Page field (InputfieldPage)?
  25. Guys, just to give you an update: I still want and have to work on this module before I can release it on github. I am changing a big part of the rendering of the actions, so they work either in card or in table view. Sadly I hadn't much time in the past, because I changed my company to a GmbH, had to design a new logo and website texts, and all that legal stuff that comes with changing your company. And don't forget about my customers, who also want their work done. I hope to get some time in the next weeks, so maybe I can work after christmas on this, but no promises.
  • Create New...