-
Posts
1,070 -
Joined
-
Last visited
-
Days Won
16
Everything posted by dotnetic
-
decimal fieldtype would be GREAT
-
One disadvantage of Klaro: Custom styling is possible, but takes some effort, and also overhead because the default styles are embedded in the script. It would be better if the default CSS is optional. You can override the custom styles if you apply a data-attribute to the klaro script. Here is what I did. Cloned the git repo and removed including the SCSS file in the script. Then compiled the SCSS with my customizing as a separate file.
-
Idea: Language config in repeater(matrix) items headings
dotnetic replied to gerritvanaaken's topic in Multi-Language Support
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. -
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.
-
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?
-
Anyways, this is a really nice module. Thank you for releasing it.
-
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.
-
I found the solution, I have to include the hook before the require in admin.php
-
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.
-
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
-
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.
- 1 reply
-
- 3
-
-
@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)
-
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.
-
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.
-
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.
-
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.
-
PW Developer Forum Login Button is Broken
dotnetic replied to Peter Falkenberg Brown's topic in General Support
I created an issue on github for this https://github.com/processwire/processwire-issues/issues/1058 -
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.
-
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.
-
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.
-
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.
-
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.