ProcessWire Weekly #532

In the 532nd issue of ProcessWire Weekly we'll cover the latest core updates, check out a couple of brand-new third party modules, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly! In this week’s issue we're going to check out what's new in the dev branch of ProcessWire this week, and highlight some ideas raised in last week's update, where Ryan was asking ProcessWire users what they'd like to see in the core package in upcoming versions.

In other news we've also got two new third party modules to cover: TextformatterTokens from ZIGIT development, and AdminInModal from Mark Evens. And, as always, we've also got a new site of the week to highlight: Kunstgeschichte unterwegs, a site that covers the lengthy history of the choir and chapels of the Freiburg Minster in Germany.

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

This week, in his latest weekly update, Ryan covers some additional updates made to the header actions feature, originally added to the core back in May. This feature was initially just for JavaScript use, but a matching PHP API was added a short while after, and since then we've had some smaller updates for it.

New this week: dropdown inputfield header actions

The latest of said updates is a new addition from this week, and essentially adds an option to add header actions that become options in a dropdown menu. A relatively simple example of this can be seen in the screenshot below, and the code used to generate this dropdown can be found from the weekly update post.

Simple example of the header actions dropdown feature, adding toggle options for selecting and unselecting all items, as showcased by Ryan in the latest weekly update.

Regarding last week's update, and future versions of ProcessWire...

As a quick update to last week's weekly update, in which Ryan asked for your feedback on the kind of features that would make sense in the next major ProcessWire version, there have been quite a few suggestions already. Some have focused on improving the development framework side of things, such as .env configuration support and custom Page classes enhancements, while others have focused more on the admin interface — including more customization options and possibly a centralized media manager.

While we're not making any promises, your suggestions are definitely worthwhile, so in case your idea isn't on the list please let us know what you would like to see in future versions. Or just voice your support for some of the existing ideas, that's fine as well!

That's all for our core updates section this week. For more details, be sure to check out the latest weekly update from Ryan at the processwire.com support forum, as well as the previous weekly update in case you're interested in the discussion around future core updates. Thanks!

New module: TextformatterTokens

TextformatterTokens is a new third party module from ZIGIT development. As the entry for this module in the modules directory explains, TextformatterTokens allows other modules to register tokens and replace them with actual values.

What this means is that you can programmatically register tokens — see the SiteTokens module that's bundled with this Textformatter for an example — which then become available in fields with TextformatterTokens enabled. There are currently two tokens automatically added by the SiteTokens module:

  • [site:name], which is automatically replaced by the value of $config->siteName when rendering the page / field on the front-end.
  • [page id=123], where id is the ID of the page. This token gets the "body" field of the page matching provided ID and outputs it.

While these built-in tokens can definitely be useful, adding new ones is quite simple. Following the example in the SiteTokens module:

if ($tokens = $this->wire()->modules->get('TextformatterTokens')) {
    $tokens->registerToken('token_name', [$this, 'handlerFunctionName']);
}

You'll have to provide a custom handler, which should return the output of the token. You can optionally pass in arguments when adding a token to the page content, and your handler will receive these arguments as an array.

If you'd like to give this module a try, you can install it via the modules manager in the admin, clone or download the code from the TextformatterTokens GitHub repository, or install it via Composer (composer require zigit-dev/textformatter_tokens). In case you have questions or need support, visit the TextformatterTokens support forum thread.

Thanks to folks at ZIGIT development for creating this module and sharing it with us!

New module: AdminInModal

AdminInModal is a new third party module created by Mark Evens. This module adds support for opening admin page in both front-end and backend of the site within a customizable modal window.

The module adds "aim" method for Page (front-end) and Inputfield (backend), which you can use to open a modal. You can also pass in various additional arguments to customize the end result:

echo $page->aim([
    'href' => null, // the url for the linked page (including GET params)
    'text' => 'Link',  // the text that will appear in the link
    'class' => "uk-button uk-button-primary",
    'width' => '90%',
    'height' => '95%',
    // etc, see the module's directory entry for all available arguments
]);

If you'd like to give this module a try, you can install it via the modules manager in the admin, or clone or download the module's source code from the AdminInModal GitHub repository. If you have questions or require additional assistance, head down to the AdminInModal support forum thread.

Thanks to Mark Evens for creating this module and making it available for the ProcessWire community!

Site of the week: Kunstgeschichte unterwegs

Our latest site of the week is called Kunstgeschichte unterwegs, a site created for the choir and chapels of the Freiburg Minster in Germany. This site covers the history of Freiburg Minster, featuring an illustrated tour, audio guides, excursions, and background information.

The Kunstgeschichte unterwegs website was created by designconcepts GmbH and, as mentioned above, contains plenty of interesting, detailed historical information, made available in multiple languages — including embedded audio introductions, which is a rather impressive feature in itself. The design of the site is also very enjoyable and has a classic, timeless feel to it, making it a great match for the site in question.

As for behind the scenes details, the front-end of this site is based on the Uikit front-end framework. Meanwhile, some of the third party ProcessWire modules used on this site include the full-featured, commercial caching and optimization module ProCache, and the Email Obfuscation module (EMO).

Thanks to the folks at designconcepts GmbH for sharing this project with us, and our congratulations to the client for their new, ProcessWire powered website!

Stay tuned for our next issue

That's it for the 532nd issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 27th of July. 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 1 comment:

designconcepts on Monday 29th of July 2024 10:56 am

Thank you for mentioning our site. :-)

Post a comment