ProcessWire Weekly #331

In the 331st issue of ProcessWire Weekly we're going to check out the latest core and Pro module updates (ProcessWire 3.0.166, ProCache 4.0.1, and Form Builder v44), introduce the Wireframe API module, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly! In this week's issue we've got a lot of core updates to dig in, as well as some news regarding Ryan's official Pro modules. We'll start by providing a quick look into all of that, and then move on to introducing a brand new third party module called Wireframe API — an optional companion module for the Wireframe output framework.

Our latest site of the week is that of Rogo Productions, which is a part of London-based indie AJH Films that develops factual, drama and comedy programmes. Their new site, built by ID Studio Web Agency, boasts a very unique design among other things; more about that in just a bit!

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.166

From the latest weekly update at the processwire.com blog you can find and extensive list of new features included in the latest version of ProcessWire (3.0.166), as well as a brief introduction to what's new in the latest releases of a couple of commercial Pro modules: ProCache 4.0.1 and FormBuilder v44.

What's new in ProcessWire 3.0.166

This release contains both bugfixes and completely new features — or, as Ryan puts it, "a lot of minor changes and fixes, but when all combined, it ends up being a pretty significant update":

  • New $config->serverProtocol runtime property for specifying which protocol the server is currently using (typically HTTP 1.1 or HTTP 2.0.)
  • New sendStatusHeader() method for the WireHttp core class to accompany pre-existing sendHeader() method.
  • Major changes to the WireShutdown class, including new setFatalErrorResponse() that makes it possible to modify fatal error HTTP code, who to send fatal error emails to, message format, and more.
  • New $database API methods including getVersion() and getRegexEngine(), mostly for use by the core, but perhaps some advanced database related site or module code as well.
  • Session class improvements, such as the ability for $session->redirect() method to send any valid redirect status code instead of just 301 or 302, and a brand new $session->location($url) method as an alias for $session->redirect($url, false).
  • New $session API method sessionHandler() that returns current session handler instance, or just null if using the default file-based PHP session handler.
  • Various improvements to the SessionHandlerDB module: 249 “too many requests” header is now sent along with retry instructions if too many requests are sent for a session ID, and you can now configure how long ProcessWire should wait to obtain a session lock before throwing this error.

Latest Pro module updates: ProCache 4.0.1 and FormBuilder v44

ProCache 4.0.1 is an incremental update to the latest major release of this module, 4.0. This version contains both fixes and new features: support for clearing CSS and JS files by age or manual select, ability to disable automatic creation of .htaccess sample files, new ProCacheStaticClear and ProCacheStaticEntry classes, HTML minification improvements, and some new hooks.

FormBuilder v44 was covered in our previous weekly issue as well as this week's update in the blog, so we won't go too deep into this either. Among other things this version introduces significant improvements to FormBuilder's entries listing features and API, making finding entries both with the GUI and with the API a breeze.

That's all for our core updates section this week. For more details about aforementioned core and Pro module updates, check out the weekly update from Ryan. Thanks!

New module: Wireframe API

Wireframe API is a newly released companion module to the Wireframe output framework. In a nutshell this module makes it very easy to open up specific parts of a Wireframe and ProcessWire powered website as a JSON API.

While there are already really great modules out there if you need a generic public API — most notably ProcessGraphQL and AppApi — the main driver behind Wireframe API is that it integrates tightly with Wireframe concepts, such as components and partials. At the moment the module comes with a set of three primary endpoints:

  • /components/[component name]/ returns data and rendered output for a single component; return type can be specified by appending "json" or "rendered" to the end of the API path
  • /pages/[page ID]/ returns data and rendered output for a single page; return type can be specified by appending "json" or "rendered" to the end of the path
  • /partials/[partial name]/ — returns the rendered output for a single partial file; if partials are nested in directories, you can provide the relative path in addition to the partial name (/partials/[directory]/[subdirectory]/[partial name]/)

Enabled endpoints are defined via site config settings (or, alternatively, module config). In addition to the built-in endpoints mentioned above it's also possible to add custom endpoints, which makes it really easy to extend the API with site-specific features.

The return value for each API endpoint is a JSON object. This object is a wrapper that contains basic information about the query — whether or not it was successful, which path was queried, etc. — as well as the actual data returned by the endpoint:

{
    "success": true,
    "message": "",
    "path": "wireframe-api\/components\/Card",
    "args": {},
    "data": {
        "json": {
            "title": "Hello World",
        },
        "rendered": "<div class=\"card\"><h2>Hello World<\/h2><\/div>",
    }
}

Error responses from the module return a similar JSON object with a human-readable message explaining what went wrong, as well as the HTTP status code that best suits that particular error: 400 for malformed request, 404 for content not found, etc.

For more details about Wireframe API, check out the Wireframe API documentation at wireframe-framework.com. This module is bundled with the Wireframe module, so if you'd like to give it a try, just install said module (or update to the latest version) and follow the getting started guide at the docs. Thanks!

Site of the week: Rogo Productions

Our latest site of the week belongs to Rogo Productions, a production company formed in 2020. According to their own words Rogo is focused on ensuring the most interesting, diverse, and entertaining voices are shown on screen. Currently they are developing a range of projects in the factual, scripted, and entertainment genres for broadcasters across the world.

The Rogo Productions website feels more like an interactive presentation than a classic website: the overall style is minimalistic, and each section is designed precisely to that specific use case; brief about and contact pages, filmography section with infinite scroll full-screen blocks, and a team section with profiles of each team member — including Charlie the office dog whose job is to "bring love and cuteness to the office".

This site was built by ID Studio Web Agency, the London based web design agency that has created a number of brilliant sites using ProcessWire — many of which have been featured as our sites of the week — and also released a very good introduction to the system. The front-end framework used on this site is Bootstrap, enhanced with the CSS animation library Animate.css, while the backend is obviously powered by ProcessWire.

Big thanks to the folks at ID Studio Web Agency for sharing this project with us, and our congratulations to the client, Rogo Productions, for their new website. This site definitely has a unique and captivating look and feel to it!

Stay tuned for our next issue

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