ProcessWire Weekly #251

In the 251st issue of ProcessWire Weekly we'll introduce ProcessWire 3.0.127, take closer look at a couple of new third party modules – CI Trigger, and Unique Image Variations – and introduce a new site of the week. Read on!

Hello there and welcome to the latest issue of ProcessWire Weekly! This time we'll check out ProcessWire 3.0.127, which is the latest version of ProcessWire currently available via the dev branch at GitHub. We'll also take a closer look at two third party modules – CI Trigger from Thomas Aull, and Unique Image Variations from Robin Sallis.

In case you're reading this post at weekly.pw, you might notice that it actually came out a day later than usual. Sorry for that, folks – due to other commitments I wasn't able to get this issue out on Saturday, and thus had to push it a day forward until Sunday. Next week we'll be back to our usual schedule.

Also, thanks to those of you pointing out that we had a milestone last week – the 250th issue, that is. Your comments and messages are always much appreciated :)

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. Enjoy our latest issue and have a great weekend!

Latest core updates: ProcessWire 3.0.127

This week in the processwire.com blog Ryan introduces ProcessWire 3.0.127, which contains nearly 30 new commits, the bulk of which are related to resolving some older GitHub issue reports. In addition to said fixes and improvements, there are also two new features in this release – more specifically two all-new page statuses called "unique" and "flagged".

Page status "unique"

The “unique” status represented by the constant Page::statusUnique is a way of specifying that a page should have a globally unique name. Meaning, no other page in the entire system can have the same name. The status itself has been present in the Page class for a while already, but this week Ryan added the code required to make it actually do something.

Now, one particularly neat feature of the unique page status is that you can access such pages without knowing where exactly they reside in the page tree, or what their ID values are. If you set a page named "settings" unique, all you need to do to grab your settings page is $pages->get('settings') – this will always return the settings page, wherever it might be.

For more details about the unique status flag and it's effects, and some additional ideas on where this might become useful, see the blog post from Ryan.

Page status "flagged"

The flagged status is represented by the constant Page::statusFlagged. Currently it's used to flag a page as one with potential errors: a page receives this flag from the Page editor when the last interactive save (i.e. one from the admin interface) resulted in one or more error messages.

Pages that have been flagged are visually identifiable in the page list, and the publish button in the page tree will also be disabled for them. While the core only applies this flag in the aforementioned admin save case, module authors may find this status interesting as well, since it can be easily added by non-core code and used for various purposes behind the scenes.

For a more in-depth introduction to the flagged status, be sure to check out the weekly blog post from Ryan. That's all for our core updates section this week – stay tuned for more core news in our future issues, and keep reading for non-core-related updates!

New module: CI Trigger by Thomas Aull

This week we have a new third party module called CI Trigger, developed by Thomas Aull. Despite the name that may sound somewhat scary – what with the continuous integration stuff and all – this is actually a very simple module, intended to make integrating a ProcessWire site with a CI pipeline a tad easier.

What CI Trigger does in practice is that when any public, non-system page is saved, it stores a boolean value for that page. Using lazy cron it then sends a POST request to a configurable webhook URL once a day. The POST behaviour is only triggered if there actually were saved pages during that time.

The actual implementation of the webhook, and the configuration of the CI behaviour, are something you need to set up yourself. Technically this module will make it possible to perform a deploy to a separate production environment etc. when – and only when – there's new content to deploy. As it stands this module is rather bare-bones, so if you have any additional ideas or suggestions for Thomas, feel free to post them at the CI Trigger support forum thread.

Big thanks to Thomas for sharing this module with us – a very nice addition indeed, and we can see a lot of potential in it particularly for slightly more advanced development and/or hosting setups!

New module: Unique Image Variations by Robin Sallis

Unique Image Variations isn't strictly speaking a "new" module, as it has in fact been around since December 2017. That being said, it hasn't been getting much coverage, yet it does a great job at what it was designed to do: making sure that any image sizer setting changes, settings provide to a size() method via the API, or image-specific changes always end up in the name of the generated image variation file.

By default, ProcessWire stores some of those settings in the filename, but omits others that are considered less critical. What Unique Image Variations does is that it adds all those missing variables to the filename as well, which in turn allows us to regenerate variations when said variables change.

In order to avoid making filenames massively verbose, various settings are added as a kind of a shorthand string to the filename. For an example a filename such as frog.400x400-u0i1s1q90f1t420l710z0.jpg can be decoded as ...

  • upscaling: false
  • interlace: true
  • sharpening: soft
  • quality: 90
  • use focus: true
  • focus position top: 420
  • focus position left: 710
  • zoom: 0

Note that if you enable this module on an existing site, this will result in all variations being recreated when they are next requested, which can cause a lot of stress on the server. If you have a very image-heavy website, this is definitely something to keep in mind. For new sites there's of course no such issue.

If you'd like to give this module a try, you can clone or download it from the Unique Image Variations GitHub repository, or install it directly via the built-in module installer in ProcessWire. If you have any questions or requests regarding this module, feel free to post them at the Unique Image Variations support forum thread.

Thanks to Robin for sharing this module with us!

Site of the week: Versatile Words

Our latest site of the week belongs to a company called Versatile Words. They specialize in all sorts of content production, and more specifically copywriting: authoring new content for the web or magazines, editing and polishing existing content, content-related coaching, and brand collaboration and information design.

The website of Versatile Words was designed by Nonfiction and developed by Process Interactive, and features an interesting design, where words are in the front and center. The copy of the site is capturing, typography well-thought-out, and non-textual content limited to the bare minimum. Overall this site reflects the company it was built for, and considering how well it works tech-wise as well, there are indeed very few reasons not to like it.

The site features some regular content pages, project introductions, and a blog section. Recognizable front-end components include a grid that looks very much like the one from Bootstrap, a few popular JavaScript libraries – most prominently jQuery and Cycle2 – and a fun little CSS animation library for implementing tasty hamburger icons called Hamburgers. There are no front-end visible third party modules in here, but what goes on behind the scenes remains largely unknown to us.

Big thanks to the folks at Nonfiction and Process Interactive for sharing this site with us, and congratulations to Versatile Words for their new, ProcessWire powered website!

Stay tuned for our next issue

That's it for the 251st issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 9th of March. 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