ProcessWire Weekly #281

In the 281st issue of ProcessWire Weekly we're going to cover the latest core updates, introduce the ExternalHTML Loader module, and check out a brand new site of the week called Vetiqo. Read on!

Welcome to the latest issue of ProcessWire Weekly! This time we don't have a new core version as Ryan has been mostly focusing on resolving open GitHub issues, so we'll just include a brief summary of the changes – though admittedly "brief" might be a bit of an overstatement here, as the list of updates is actually quite lengthy.

In other news we're going to take a closer look at a new-ish third party module called ExternalHTML Loader, and showcase a brand new site of the week belonging to Vetiqo, who produce and sell animal-friendly practical practice utilities for veterinarians.

Now, there's just one more thing before we can get into business: the Architekturführer Köln website that we featured as our site of the week back in June is now a nominee at Awwwards. Built by schwarzdesign, this very interesting site is actually a SPA combining ProcessWire backend with Vue.js + Bootstrap front-end. Best of luck in the contest!

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: various fixes and improvements, and a few new features

While there's no new core version for this week – the focus for the past week has been on working through the issues repository – there are still a total of 18 commits for the past week. Among these are various fixes, optimizations, and other minor updates.

Here are some of the fixes introduced to the dev branch this week:

  • Fix for a recent issue rendering password fields (and some fields using a 3rd party fieldtype) uneditable was resolved.
  • Fix for an issue where API generated WebP images were not properly removed with the source image.
  • Fix for an issue where identical queries with sort=random resulted in exactly the same return value due to caching.
  • Fix for an issue where $page->get() return format for file fields was sometimes inconsistent if multiple fields were used.

Here are some of the updates that either improve the Admin experience, or improve and/or optimize the behaviour of core features:

  • Updates to certain Admin side messages, making them easier to grasp, more consistent, and more in line with what actually happened behind the scenes.
  • Improved handling for menu caches in Admin, i.e. invalidating menu cache when the language of the user is changed.
  • An optimization for Page::setQuietly() for storing integer settings (such as status, sort order, and specific timestamps) directly.
  • More consistent cloning behaviour, making sure that the cloned Page references correct created/modified user.
  • $input->requestMethod() now returns correct value for HTTP PATCH requests.

Additionally some brand new features were also merged into the core this week – it's quite possible that we'll cover these in more detail in the (near) future, but here's a quick rundown:

  • PageArray::getSelectors() now accepts an optional boolean parameter: if set to true, the method returns the selectors as a string.
  • WireArrays that haven't been "wired" yet can now automatically inherit the Wire object from added items (in case they are wired).
  • Added support for a number of new and optional files that can be automatically included when execution reaches a certain state, similar to existing /site/init.php and /site/ready.php. See the statusFiles config setting for more details.

... and that's it for the core updates this week. In case 3.0.142 is out when our next issue is due, we'll most likely cover some of this week's updates – particularly the statusFiles setting – in more detail then, so stay tuned for that.

New module: ExternalHTML

ExternalHTML Loader is a third party module that was released in July but never added to the modules directory, which is why we've only just learned of its existence. Now, the primary goal of this module is to pull in some piece of pre-rendered HTML content from an external URL, cache it, and then serve it to visitors on a ProcessWire site:

$html = $modules->get("ExternalHTML");
echo $html->render("https://murb.nl");

By default the module fetches full HTML markup from the source, caches it locally into /site/cache/ExternalHTML/ for 30 minutes, and then outputs it as-is. In case you need to customise the default behaviour somehow, you can do that by modifying supported options, which should be used as properties of the module class:

  • $html->onlyBody = true: render only the body's contents (default = true)
  • $html->fragmentId = "main": render only a fragment by selecting parent element by id (overrides the onlyBody parameter, default = "")
  • $html->cache = 3600: set the cache time in seconds
  • $html->useCacheOnLoadError = true: use cached content if loading content fails (default = true)
  • $html->stripTags = false: strip out any HTML tags (default = false)
  • $html->encodeEntities = false: encode any entities (default = false)

If you'd like to give this module a try, keep in mind that it's currently not in the modules directory, so be sure to follow the install instructions in the GitHub repository – which basically boils down to grabbing the zip package of the module repository from GitHub, or cloning the repository into your site's /site/modules/ directory.

Thanks to Maarten Brouwers for developing this module and sharing it with us – we're sure that it'll come in handy for some future projects!

Site of the week: Vetiqo – Innovation in Teaching

Our latest site of the week, Vetiqo, belongs to Veteducators GmbH – a Berlin, Germany based company developing tools for teaching veterinarians practical skills such as suturing and applying injections.

The products developed and sold by Vetiqo allow for practical practice without risking animal welfare, or the students themselves. As such, their models are used not just for training veterinarians, farmers, and veterinary technicians, but also in experimental animal science.

The Vetiqo website was developed by Neue Rituale, and you can find more resources and a brief case study of the project from their portfolio under Vetiqo Corporate Design & Shop. The website consists of regular content pages and an integrated webshop built with the Padloper e-commerce module. A few highlights from the case study:

  • The interface is minimalist and follows a clear structure, bringing the innovative Vetiqo products to full advantage.
  • The multi-level caching system reduces load times to a few milliseconds.
  • The different levels of information, multilingualism, and the use of structured data (JSON-LD) promote search engine findability.

Big thanks to the folks at Neue Rituale for sharing this project with us, and our congratulations to Veteducators for their brilliant new website. Definitely a great job from everyone involved in this project!

Stay tuned for our next issue

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