Leaderboard
Popular Content
Showing content with the highest reputation on 09/07/2020 in all areas
-
In MySQL `NULL` is always less then any non-null value. Therefore you either need to sort at runtime, somehow make the sql query issued sort by `ISNULL(col), col` with different directions or use my paginator module for paginating though multiple different selectors: https://github.com/LostKobrakai/Paginator2 points
-
I use a hook for something similar /** CUSTOM PAGE SORT * related for InputfieldPageListSelect, ProcessPageList (Page tree) * */ $wire->addHookBefore('ProcessPageList::find', function($e) { $parent = $e->arguments(1); $selectorString = $e->arguments(0); // modify $selectorString, remove, modify, add ',sort= ...' $e->arguments(0, $selectorString); });2 points
-
I think you don't need a workaround with a hidden field if you do the hook after and change the PageArray instead of the selector. $wire->addHookAfter('ProcessPageList::find', function($e) { $pages = $e->return; if ($pages->first()->parent->id != 111111) return; // quick exit if parent doesn't match $zeroDatePages = $pages->find("date=''"); // empty date pages $result = $pages->filter('date>0,sort=-date'); // pages with date, sort descending $result->prepend($zeroDatePages); // prepend empty date pages $e->return = $result; });1 point
-
I have never used MAMP but the following setup should work... Your MAMP htdocs folder (the one with wire inside), should have a structure like this. site site-blog site-another site-dev wire .htaccess composer.json CONTRIBUTING.md index.config.php index.php LICENSE.TXT README.md Note the index.config.php. Do you have that? Inside it reads: Your index.config.php (that you moved/copied from wire/index.config.php) <?php namespace ProcessWire; /** * ProcessWire multi-domain configuration file (optional) * * If used, this file should be copied/moved to the ProcessWire installation root directory. * * ProcessWire 3.x, Copyright 2016 by Ryan Cramer * https://processwire.com * */ if(!defined("PROCESSWIRE")) die(); /** * Multi-domain configuration: Optionally define alternate /site/ dirs according to host * * If used, this file should be placed in your web root and then edited as follows. * * This function returns an array that should be in the format where the array key * is the hostname (including domain) and the value is the /site/ directory you want to use. * This value must start with 'site-', i.e. 'site-domain' or 'site-something'. This is to * ensure that ProcessWire's htaccess file can recognize and protect files in that directory. * * Note that if your site may be accessed at either domain.com OR www.domain.com, then you'll * want to include entries for both, pointing to the same /site-domain/ directory. * * Each /site/ dir has it's own /site/config.php file that should be pointing to a separate * database. You shouldn't have two different /site/ dirs sharing the same database. * */ function ProcessWireHostSiteConfig() { return array( /* * Some Examples (you should remove/replace them if used). * Just note that the values must begin with 'site-'. * */ 'mydomainblog.com' => 'site-blog', 'www.mydomainblog.com' => 'site-blog', 'anotherdomain.com' => 'site-another', 'dev.mydomain.com' => 'site-dev', /* * Default for all others (typically /site/) * */ '*' => 'site', ); } Each site* will have its own site/config.php, with the correct credentials. ProcessWire will do the rest. Of course, you need all your domains working first, even locally. E.g. dev.mydomain.local, etc. in your hosts file.1 point
-
Changelog for Wireframe 0.14.0: ### Added - New ComponentView class, as well as the ability for component views to access Component class public methods as properties, in the same way view files and layouts can access Controller class public methods. ### Changed - Hook related code moved from Wireframe module to separate Hooks class. - Accessing public class methods as properties in view files were moved into new trait MethodPropsTrait. This is used internally by Controller and Component classes. - Some minor improvements related to dependency injection within Wireframe objects (and ProcessWire objects instantiated by Wireframe.) @bernhard, what you suggested here... ... is now doable. The way it works is just like with Controllers (this functionality is provided by a new shared trait behind the scenes): <?php // component class namespace Wireframe\Component; class Test extends \Wireframe\Component { public function hello() { return 'world'; } } // component view hello <?= $this->hello ?>1 point
-
For whatever reason, the power was out for our neighborhood for one day this week. As a result, I’m running a day behind schedule here and haven’t yet finished some of the updates I’ve started in the core, so no core updates to report just yet. Instead, I’ve been focused on finishing up the newest FormBuilder version, which has taken nearly the whole week to finish, but I did manage to get the new version out today (available in the FormBuilder board), and I’m really happy with what it adds. Here’s what's new in version 44 of FormBuilder: This version makes significant improvements to FormBuilder's entries listing features and API. You can now find submitted form entries with selector strings just like you can with pages in ProcessWire. It’s like using $pages->find() except for form entries. You can perform queries on any field in the form and use several different operators. This also includes some of the new text matching operators new to the most recent PW master version. The entries screen for any form now gives you option to search and/or filter based on any field in the form. You can also create multiple filters on top of one another, matching multiple fields or even multiple values for the same field. You can dynamically select what columns appear in the entries list, and in what order. This is very much like the “Columns” tab in Lister or ListerPro. You can also search, filter, display and export field values from nested forms, which was not supported in earlier versions of FormBuilder. You can stack multiple search filters on top of one another for AND conditions. When it comes to keyword searches, in addition to searching individual fields in an entry, you can also search all fields in the entry at once (something you can't easily do with pages). You can now sort by any form field in the entries list by clicking the column headings. Also supports reverse order. In earlier versions of FormBuilder, you could only sort by ID or created date. The CSV export has been improved with options to export based on your filters/columns selection, or export all rows/columns. In addition there are now options for letting you specify what type of column headings to use and whether or not to include a UTF-8 byte order mark (which some MS Office apps apparently prefer). In addition to all of the above, there have been numerous other minor optimizations, bug fixes and other improvements throughout FormBuilder. A few new hooks have also been added in FormBuilderProcessor. Note that versions 41, 42, and 43 were all minor-update versions that were only released casually in the FormBuilder board for specific cases. Version 44 of course also includes the updates from those 3 versions as well. FormBuilder v44 requires ProcessWire 3.0.164 or newer. To support the new search/filter/sort functions in the entries list, you must have MySQL 5.7 or newer. For earlier versions of MySQL, these features are disabled except for the “search all fields” option. Next week: back to core updates, and hopefully the newest ProCache version will be ready as well. Thanks for reading and have a great weekend!1 point
-
Also check out http://devilbox.org/ its cross platform, mature and actively developed.1 point
-
You may also want to take a look at vscodium. It's the same as vscode but without microsoft's tracking. It is free also.1 point
-
I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part, the API will work on it's own). Check it out here: https://github.com/thomasaull/RestApiProfile I'm pretty sure, it's not the perfect or most sophisticsted solution, but it gets the job done for me… Feedback or Improvements are very welcome Update: This site profile is a module now: https://github.com/thomasaull/RestApi1 point
-
Seems great. Awesome Job!. Thanks for sharing. I think the JWT Auth may become a module on it´s own. For folks who don´t know about JWT. It´s a standard for Authentication Using Json. https://jwt.io/1 point
-
If you are using cloudflare.com you might also want to create a page rule like: *mydomain.com/processwire/* Security Level = High Cache Level = Bypass Disable Apps Disable Performance This should prevent any of the Processwire admin from being proxied by cloudflare.1 point