ProcessWire Weekly #455

In the 455th issue of ProcessWire Weekly we'll check out the latest core updates, introduce a new third party module called JkPublishPages, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly, hope you folks have had a nice and relaxing weekend so far. In this Weekly issue we're going to kick things off by diving into the latest update from Ryan, in which he explains how to use a couple of new hookable methods added to the core just this week.

We've also got a brand-new third party module to introduce: JkPublishPages, developed by Jürgen K. to replace his earlier PublishingOptions module. And, as always, we're also going to highlight a new site of the week, which this time belongs to Peggy Guggenheim Collection — a museum dedicated to European and American art of the 20th century.

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 instructions for adding new buttons and actions to images in the admin

The focus of the latest weekly update from Ryan is on a new feature added to the core just this week: the ability to add new action buttons to admin image fields by hooking into InputfieldImage::getImageThumbnailActions() for buttons that should appear on top of a thumbnail, or InputfieldImage::getImageEditButtons() for buttons that should instead appear next to the existing actions in list mode view.

This feature was inspired by a pull request for a download button, and though the end result is not exactly that what was proposed in the pull request, a download button is exactly what is used as an example of what one can easily achieve with said new hooks.

Here's what a method implementing a download button for image fields might look like:

$wire->addHookAfter('InputfieldImage::getImageEditButtons', function(HookEvent $event) {
    $image = $event->arguments(0);
    $class = $event->arguments(3);
    $buttons = $event->return;
    $icon = wireIconMarkup('download');
    $buttons['download'] = "<button class='$class'>"
        . "<a download href='$image->url'>$icon Download</a>"
        . "</button>";
    $event->return = $buttons;

As for other updates added to the core this week, those include relatively minor fixes, such as a couple of issues related to Sanitizer date and text methods, and one where using either "childTemplates" or "parentTemplates" in a call to the $templates->find() method resulted in an array to string conversion error.

That's all for our core updates section this week. For more details, be sure to check out the weekly update from Ryan at the support forum. Thanks!

New module: JkPublishPages

JkPublishPages, as module author Jürgen explains in the forum thread introducing this module, is a rebuilt version of an earlier module called PublishingOptions. This is a PHP 8 based modernized version, with some new options available. Whereas the old module could only publish or unpublish pages based on defined dates, this version can...

  • unpublish the page when a date is reached,
  • move the page to trash when a date is reached,
  • delete the page permanently when a date is reached, or
  • move the page to a new position in the page tree when a date is reached.
JkPublishPages publishing options GUI. Screenshot by module author Jürgen K.

Essentially this module can be used to not just publish or unpublish pages, but also to completely dispose of unwanted old content, or alternatively to create automatic, date based archives. You can find more examples, screenshots, and detailed instructions from the JkPublishPages GitHub repository.

Please note, though, that this module is currently considered an alpha release, so we must recommend that you test carefully before implementing it on a live site. In case you run into any issues, feel free to report them via the GitHub repository.

Big thanks to Jürgen for his work on this module — it looks like a tremendously helpful tool, and will no doubt find its way into various ProcessWire powered projects in the near future. Keep up the good work!

Site of the week: the Peggy Guggenheim Collection

Our latest site of the week is that of Peggy Guggenheim Collection, which is a museum of European and American art of the 20th century located in Palazzo Venier dei Leoni, on the Grand Canal in Venice, Italy.

The museum hosts the personal collection of Peggy Guggenheim, who was born in New York on August 26, 1898, and acquired Palazzo Venier dei Leoni in 1949. Since 1951 she began to open her home and collection to the public free of charge, and following her death in 1979 the Peggy Guggenheim Collection opened its doors in 1980.

The website of the Peggy Guggenheim Collection was crafted by Basilico, and in addition to an absolutely gorgeous design contains plenty of details about the museum; the history of the collection and Peggy Guggenheim; past, current, and future exhibitions; and more. The site is also multilingual, with content available in English and Italian.

We developed a content management system so that the different departments of the museum could organize the content independently. The museum staff will gradually update the web platform with new and original data. In this way the digital archive can best fulfil its role as an online resource accessible to everyone.

— Basilico, in the sites directory entry for the Peggy Guggenheim Collection

As for behind the scenes details, there's not a whole lot we can tell, except that it looks like the front-end of this site was largely custom-built, without the help of a full-blown front-end framework — and of course that the end result is really quite brilliant. If any third party ProcessWire modules were used on this site, they remain hidden behind the scenes, so not much to report on that front either.

Big thanks to the folks at Basilico for sharing this very interesting project with us, and our congratulations to both the client and the team behind the implementation for a job well done — absolutely stunning work!

Stay tuned for our next issue

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

Post a comment