ProcessWire Weekly #456

The 456th issue of ProcessWire Weekly covers latest core updates, introduces a new third party module called TextformatterRockDown, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly! In this week's issue we're going to check out the latest weekly update from Ryan, as well as the latest updates to the dev branch of ProcessWire at GitHub.

In other news we'll introduce a new third party module called TextformatterRockDown, developed by Bernhard Baumrock, and as always we'll also highlight a new site of the week — a very interesting project by Centric Lab focused on identifying environmental stressors for UK based residents.

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 and a weekly update from Ryan

In his latest weekly update Ryan talks about an ongoing project, which involves working with a third party API, and the headaches that kind of work sometimes entails. As most of ProcessWire users out there can probably agree, ProcessWire itself has a pretty nice API for development purposes, but that's definitely not something to take for granted.

It reminded me of one reason why ProcessWire was built in the first place, to create a simple interface to things that are not-so-simple behind the scenes, and I think we've been pretty successful with that. We'll keep doing that as ProcessWire continues to mature, evolve and grow, as we always have.

— Ryan

Be sure to check out the weekly update for more details, and feel free to join the discussion and share your own experiences, ProcessWire related or otherwise!

Weekly core updates

As for latest weekly core updates, there have been some commits to the dev branch in GitHub during this past week — some of these pretty big and potentially influential, others a bit less involved. Here's a summary of what's new this week:

  • PagesParents class was updated with a new, experimental method used pages are moved or cloned. This was done primarily to improve scalability when the site has considerable amount of pages (hundreds of thousands, or more than a million), in which case updating the parents table could become a bottleneck.
  • An update to PagesRequest core class that redirects requests with two slashes at the end to the single-slash version automatically.
  • An update to the ProcessPageEditLink core module, adding new options to set a visible label for selectable "class", "rel", and "target" options and clarifying instructions related to said options.
  • Pull request 257 was merged, replacing utf8_encode() method — which has been deprecated in PHP 8.2 — with mb_convert_encoding().
  • Various fixes and optimizations to debug mode detection, including a fix for an issue where using the $config->debugIf option to conditionally enable debug mode was not behaving as it should've.
  • A fix for an issue where (since ProcessWire dev version 3.0.211) the find() method wasn't working properly in some situations, such as when trying to find fields or Table field rows.
  • A couple of fixes for Repeaters, where files using the secureFiles option could get blocked even if the parent page allowed them to be accessible, and where having a Repeater field inside another Repeater field on a user template caused errors.
  • A fix for an issue where under specific circumstances attempting to clone a page could result in a fatal error.

That's all for our core updates section this week. For more details feel free to browse the dev branch commit log, and be sure to check out the weekly update from Ryan at the support forum as well. Thanks!

New module: TextformatterRockDown

TextformatterRockDown is a new third party module developed by Bernhard Baumrock. This textformatter module provides support for simple markdown like formatting, ideal — according to module author Bernhard — for headlines:

*bold*
_italic_
~strike~
```monospace```
#monospace#

In case you need custom replacements that are not natively supported by this module, you can add them programmatically by hooking to the TextformatterRockDown::replace method. Here's one example:

$wire->addHookAfter("TextformatterRockDown::replace", function ($event) {
    $str = $event->arguments(0);
    $start = $event->arguments(1);
    $end = $event->arguments(2);
    $str = preg_replace(
        "/$start@(.*?)@$end/",
        "$1<span style=\"color:red;\">$2</span>$3",
        $str
    );
    $event->return = $str;
});

If you'd like to give this module a try, you can install it via the built-in modules installer, or clone or download the source code from TextformatterRockDown GitHub repository. In case you have any questions, suggestions, or need additional instructions, head down to the TextformatterRockDown support forum thread.

Big thanks to Bernhard for developing this module and sharing it with us!

Site of the week: Right to Know

Our latest site of the week is one called Right to Know — a project by Centric Lab. This site was originally introduced to the ProcessWire community by the developer Ben Byford in a showcase forum post way back in 2021.

In a nutshell Right to Know is a data driven website that allows users to check local area's stressors — e.g. air quality issues, noise and light pollution, summer heat, etc. — based on provided post code. The site reports values, provides relative grades, and explains in detail how each identified stressor can (and likely will) affect residents of the area.

I did quiet a bit of database stuff to host postcode lookup on the site and caches any API results for teh stressors on site for fast second query. We also choice against any tracking on the site (google analytics etc) and only track the number of total queries and number of requests to each specific postcode.

— Ben Byford

As for behind the scenes details, the front-end of this site appears to be largely hand-crafted, with some help from third party libraries, such as the Flickity carousel plugin. One and only third party ProcessWire module we could spot on the site is the AIOM+ (All in One Minify) minification and caching tool, developed by David Karich.

Thanks to Ben Byford for sharing this project with us, and our congratulations to the client for this brilliant site — this site is a valuable resource and a very interesting project altogether!

Stay tuned for our next issue

That's all for the 456th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 11th of February. 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!

This post has 2 comments:

Horst on Friday 10th of February 2023 13:25 pm

Hi,
the link to "AIOM+ (All in One Minify)" doesn't work.

teppo on Saturday 11th of February 2023 16:56 pm

Thanks Horst, fixed!

Post a comment