Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/28/2019 in all areas

  1. I've been working remotely this week and haven't had a good place to sit or very particularly reliable internet, so I've put my attention towards things that I could make progress with in small and inconsistent chunks of time. As a result, it worked well to focus on resolving issue reports this week. In addition to updates mentioned last week, 3.0.134 resolves 18+ issues and contains roughly 25 commits relative to 3.0.133. Since most of the commits since last week are focused on resolving issue reports, I don't have much to write here beyond what's in the commit log, but do want to thank everyone for their reports and hope that you have a great weekend!
    15 points
  2. After forgetting the class name of the wonderful AdminPageFieldEditLinks module for what feels like the 100th time I decided I needed to give my failing memory a helping hand... Autocomplete Module Class Name Provides class name autocomplete suggestions for the "Add Module From Directory" and "Add Module From URL" fields at Modules > New. Requires ProcessWire >= v3.0.16. Screencast Installation Install the Autocomplete Module Class Name module. Configuration Add Module From Directory Choose the type of autocomplete suggestions list: "Module class names from directory" or "Custom list of module class names". The latter could be useful if you regularly install some modules and would prefer a shorter list of autocomplete suggestions. The list of class names in the modules directory is generated when the Autocomplete Module Class Name module is installed. It doesn't update automatically (because the retrieval of the class names is quite slow), but you can use the button underneath when you want to retrieve an updated list of class names from the directory. Add Module From URL If you want to see autocomplete suggestions for the "Add Module From URL" field then enter them in the following format: [autocomplete suggestion] > [module ZIP url] Example: RepeaterImages > https://github.com/Toutouwai/RepeaterImages/archive/master.zip Awesomplete options The "fuzzy search" option uses custom filter and item functions for Awesomplete so that the characters you type just have to exist in the autocomplete suggestion item and occur after preceding matches but do not need to be contiguous. Uncheck this option if you prefer the standard Awesomplete matching. Custom settings for Awesomplete can be entered in the "Awesomplete options" field if needed. See the Awesomplete documentation for more information. https://github.com/Toutouwai/AutocompleteModuleClassName https://modules.processwire.com/modules/autocomplete-module-class-name/
    3 points
  3. That's because ultimately the references depend on the execution of the FieldtypePage::findReferences() method. This method has to be called for each page you want to get or count the references to. And so the number of references is not a simple value in the database that you can query in a $pages->find() selector the way a field value is. Enabling selectors that query or sort by the number of references is one of the motivations behind the Connect Page Fields module. If you use this module to create a two-way relationship between Page Reference fields then it's easy to write the selector you want. Note that you can set the visibility of a Page Reference field to hidden if you don't need to see it in Page Edit but only want to query it in selectors.
    3 points
  4. 2 points
  5. Imho, This functionality really should be in the core Gideon
    2 points
  6. Another hidden treasure in the PW Backend: PW 3.0.61 introduced the VEX library for dialogs: https://processwire.com/blog/posts/processwire-3.0.61-master/#admin-and-ui This is how you can use them in your custom admin pages: In your module's php load the vex library (eg in the ready() method of your module - init() might not work as it might load too early!) $this->wire('modules')->get('JqueryUI')->use('vex'); Then in your javascript: // show confirm dialog ProcessWire.confirm('Are you sure you want to delete this E-Mail?', function() { // on confirm $i.removeClass('fa-trash').addClass('fa-spin fa-spinner'); $.get('./trash/?mailid=' + $a.data('mailid'), function() { $a.closest('.RockGridWrapper').find('.rockgridbutton.refresh').click(); }); }, function() { // on abort grid.api().deselectAll(); }); Result: I opened a pull request with a little fix for handling clicks on the CANCEL button. If you want to support it, give it a thumb: https://github.com/processwire/processwire/pull/108
    1 point
  7. Thank Elabx, that's very helpful. I will make further trials with markup regions in hooks, but as I was a bit in a hurry I solved it the old way ? ... making a str_replace on $event-return. wire()->addHookAfter('Page::render', function($event) { $event->return = str_replace('<header>', '<header>' . $this->banner->markup(), $event->return) . $this->banner->assets(); });
    1 point
  8. We had this issue recently, it's because of the limit of Input variables in your PHP configuration. Adjusting the value of max_input_vars in your php.ini file to a larger number will increase the number of items you can save ?
    1 point
  9. @Robin S really really nice would be, if we can load a custom list with names AND optionally individual download URLs, so that we also can include modules that are not in the official directory. Priority: If a module is selected that has a individual download URL, paste it into the "Add Module From URL" field. What do you think?
    1 point
  10. But referenced to what? You use $pages->find(), not $page->numReferences.
    1 point
  11. I don't know how many times I write ProcessDatabaseBackup just to find out it needs to be plural.
    1 point
  12. This seems like a really nice ux update. I really like you improving existing functionality. Thanks!
    1 point
  13. TemplateFile::render does seem to be a good place to tweak the markup right before it goes into the MarkupRegions class. Is that one not working? Here is where the template is rendered: https://github.com/processwire/processwire/blob/master/wire/modules/PageRender.module#L514 Here is where the markup regions are populated: https://github.com/processwire/processwire/blob/master/wire/modules/PageRender.module#L524
    1 point
  14. Hi kongondo, one of our customers asks, if it would be possible to write out not only the usage amount of media manager items, but also all usages as list with concrete info about field, page etc. I know, this isn't going to be easy, but maybe it's worth the effort, if other users reported the same idea? Greetings, Thomas.
    1 point
  15. I've managed to resolve the problem. I actually still think the issue might be a core ProcessWire one, but at least I know how to fix it now. Yes, I'm using the PW3 branch of Padloper, and it's working fine on other sites on my WAMP setup. I'm using AIOM+ on many sites with PW3 and it's working fine on all the others. I tried manually deleting all the entries in the cache table in phpMySQL and that allowed me to get into the site admin again temporarily, although it gave some notification about some modules that actually are present not being installed. I went to modules, and did a refresh, and the error came back. One thing I noticed that I wonder about, but don't know enough about how Processwire handles loading modules, is looking at the Modules.site/modules/ entry in the cache table, the modules seem to be listed in alphabetical order, and the offending module that is generating the error is listed before the module that it depends on, which it claims can't be found. I'd hope this shouldn't matter, as it could have serious implications for module naming, as the offending module was working previously, but it seems it does. I manually edited the order of the modules listed in the cache entry via phpMySQL, and the error went away. I've tracked down the issue with AIOM+ I think. There was a namespace conflct in that a reference to a root PHP class was picking up the ProcessWire namespace and obviously not working. I think I must have added a namespace statement to the module so that the module compiler didn't have to do it, but forgot to check any possible conflicts. The good news is AIOM+ works fine without namespaces in Processwire 3.x I think the AIOM+ problem might have actually been a red-herring with me trying to add namespaces to everything to try to get the first error to go away. The real culprit here is that if the Modules.site/modules/ gets regenerated somehow, it seems it can potentially break a site, as it will add modules in alphanumeric order, and if a module depends on another one that comes later in the sort order, then the class will not be found. This can be fixed with careful naming of modules so that a module that has dependencies will always be listed after any dependencies, so in the case of PaymentInvoice, since it depends on PaymentModule, it probably should have been called PaymentModuleInvoice which would ensure that regenerating the modules cache would always load it after PaymentModule.
    1 point
  16. Well, that depends... If you have a domain for the site or create a subdomain for the site, then we are talking about two different situations. For example in the case of a standard cPanel only account: say you have dev.example.com and want to install ProcessWire in /public_html/dev_example, in that case the default .htaccess file just does its job fine. However, when I moved the "main" site – which runs under the domain the cPanel account is tied to – to a subdirectory, only these rules did the trick for me: RewriteCond %{HTTP_HOST} ^(www.)?szabesz\.hu$ RewriteCond %{THE_REQUEST} \s/+szabesz_hu/(\S*)\s [NC] RewriteRule ^ /%1 [R=302,L,NE] Where szabesz.hu is my site, szabesz_hu is the subdirectory. I inserted this before the line RewriteCond %{REQUEST_FILENAME} !-f Also $config->urls->root = '/'; must probably be present in /site/config.php to get page()->url return the url segments without the subfolder being part of it, more on this: https://processwire.com/api/ref/page/url/ Nothing else I found in the forum or in the docs worked in my case. And there are other situations as well, but I just wanted to point out this one, since I had to google around to solve it. Your scenario can be different though, so you might want to provide some information about what you exactly want to solve .
    1 point
  17. This gets you the label in the context of the entered template. $templates->get("template_name")->fieldgroup->getField('body', true)->label; You could also do this to get for the template of the current page: $templates->get($page->template->name)->fieldgroup->getField('body', true)->label;
    1 point
×
×
  • Create New...