ProcessWire Weekly #322

In the 322nd issue of ProcessWire Weekly we're going to focus on the latest core updates, take a closer look at the newly released Wire Text Tools (EN) module, and introduce a brand new site of the week. Read on!

Welcome to the latest issue of ProcessWire Weekly! This time we're going to kick things off by introducing the latest core updates from Ryan; these include a bunch of new API methods, and also a brand new documentation page for selector operators.

In addition to the core news we're also going to dig a bit deeper into a module that we briefly mentioned last week: Wire Word Tools. This module was developed by Ryan along with the word alternative features introduced last week, and it's an important piece in getting the core to properly handle English inflection and lemmatization.

Last but not least, our latest site of the week belongs to a photo studio based in Ghent, Belgium: Studio Deprez. Stay tuned for more details!

Thanks to all of our readers for being here with us again, and as always, any feedback is most welcome – please don't hesitate to drop us a line if there's anything in your mind you'd like to share with us.

Latest core updates: ProcessWire 3.0.162

This week's core release, 3.0.162, was introduced by Ryan in a post at the support forum. In addition to various smaller fixes, optimizations, and documentation updates — most related to native 2FA support and the new search operators introduced in last couple of versions — this release also introduces a collection of all-new API features.

New API methods in 3.0.162

Based on the dev branch commit log for the past week, here's a list of new API methods available as of ProcessWire 3.0.162. Mostly PageArray additions, but there's one addition for the Field class and another for the User class as well:

  • PageArray::getPage($key): similar to the get() method, but can only return a Page or a NullPage, whereas get() can return a number of other variable types as well.
  • PageArray::findOnePage($selector): again similar to the findOne() method, but can only return a Page or a NullPage.
  • PageArray::getPageByName($name): get Page from the PageArray with provided name, or a NullPage if no matching page found.
  • PageArray::getPageById($id): get Page from the PageArray with provided ID, or a NullPage if no matching page found.
  • Field::getContext($for): get current Field object in the context of the provided Page/Template.
  • User::hasTfa($getInstance = false): check if user has two-factor authentication enabled, and if it is, return the two-factor module name (or module instance if boolean true provided as argument).

There's also PageArray::getPageByProperty(), which is what PageArray::getPageByName() and PageArray::getPageById() use internally, but this one is marked "internal", so it's not an official part of the public API.

New documentation page dedicated to selector operators

One more non-core, but equally important, update introduced by Ryan this week is the Selector Operators documentation page at processwire.com. This page contains a list of all available operators, and detailed introductions for each of them.

Definitely check the new documentation page out, especially if you're still feeling a bit lost with all the recent operator additions. Also — just in case you managed to miss it initially — there's a very neat selector test tool at the 3.0.160 announcement blog post.

That's it for our core updates section this week. Be sure to also visit the weekly update post from Ryan for some additional insights and a quick note on what to expect from future core and pro module updates. Thanks!

New module: Wire Word Tools (EN)

Wire Word Tools is a new module developed by Ryan. Briefly introduced in our previous issue, this module is what gives the core capability to automatically figure out English language alternates for search terms, but there's actually more to it: it also provides an API for English word inflection and lemmatization.

The default mode of operation for this module is fully automatic, hooking into the newly added WireTextTools::wordAlternates() method, but if you happen to need similar features in your own code, you can access the API directly:

// Get an instance of the module
$tools = $modules->get('WireWordTools');

// Get a list of alternate words (returns [ 'words', 'worded', 'wording' ])
$words = $tools->getWords('word');

// Get plural value of a word (returns "words")
$plural = $tools->getPlural('word');

// Get singular value of a word (returns "word")
$singular = $tools->getSingular('words');

Now, one interesting aspect about the Wire Word Tools module is that — according to the README at GitHub — it currently focuses on the English language. This could leave the door open for future expansion to new languages, something that might be of interest to a sizeable portion of our user base building sites in other languages.

For more details, check out the WireWordTools GitHub repository. You can install this module directly via the built-in modules manager, or clone or download the module package from the GitHub repo to install manually. Thanks!

Site of the week: Photostudio Deprez

Our latest site of the week belongs to Photostudio Deprez — a professional photo studio based in the city of Ghent, Belgium. They specialize in portraits, beauty, and advertising, providing a full-service package ranging from photoshoots to pre- and post production, location hunting, casting, styling, and make-up.

The Photostudio Deprez website was developed by Thibault Van den Broecke of Giestig, also based in Ghent. The design of the site is what one might describe as timeless: the focus here is on the content, and particularly the amazing photographic material, and visual elements — and color, for that matter — are kept to the bare minimum. The font choices and typography in general look fantastic, and just overall the site is enjoyable to use. Very nice example of minimalistic design in action.

Behind the scenes this site appears to be using the Materialize CSS framework, as well as some smaller JavaScript and CSS tools and libraries, such as Waves and PhotoSwipe. We can't say much about the backend implementation here, except that there are no signs of familiar third party modules.

Big thanks to Thibault Van den Broecke aka Giestig for sharing this project with us, and our congratulations to Photostudio Deprez for their new, ProcessWire powered website. It's looking just marvelous!

Stay tuned for our next issue

That's all for the 322nd issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 18th of July. As always, ProcessWire newsletter subscribers will get our updates a few days later.

Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!

Post a comment