ProcessWire Weekly #378

In the 378th issue of ProcessWire Weekly we'll cover the latest core updates, share a new recipe of the week, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly. We'll kick this issue off by checking out the latest core updates for the week (ProcessWire 3.0.183 dev), before moving on to a brand new recipe of the week in which we lay out a couple of ways to use non-page data as selectable field values.

As for our site of the week, we've got a splendid co-project from Jonathan Lahijani, Teak, and Base: the website of The Geffen Playhouse, a not-for-profit theater company based in Los Angeles, California. Read on for more details about this very interesting project.

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: ProcessWire 3.0.183

In his latest weekly update at the support forum Ryan introduces ProcessWire 3.0.183, our latest development version. Compared to ProcessWire 3.0.182, 3.0.183 contains ~30 new commits which include fixes for 23 issues reported via GitHub, as well as minor improvements here and there.

Here's what's new in the core since last week:

  • Fix for an issue where creating a link in CKEditor field was removing styles, such as bold and italic, from selected text.
  • Fix (or an improvement) for case where inputfield dependencies prevented saving a field when it had a negative showIf condition (!=) referring to a non-visible field.
  • Fix (or, again, an improvement) for case where debugging ProcessWire's config before the system had fully booted up was causing errors.
  • Fix for an issue where $user->isLoggedin() was returning potentially confusing values when the $user object was not current user. Now this method only returns true if a) current user is logged in and b) $user is current user.
  • Fix for an issue where WireArray::prepend() reversed the order of options in a WireArray when it was prepended to another WireArray.
  • Fix for an issue where entering value 0 (zero) in the "chop/prune" feature in the logs view in Admin caused on error.
  • Fix for an issue where FieldtypeOptions option values were not removed from the database when the field itself was removed.
  • Fix for an issue where adding user page with a custom template to custom location on the site via the Page Tree "new" button resulted in an error.
  • Minor improvement to the Page Editor where the headline (seen above editable fields) now auto-updates real time if you modify the value of the title field.
  • New option for CKEditor inline mode where the editor respects "rows" setting, i.e. the height of the field is fixed instead of automatically scaling based on content.
  • New 'user' option for $pages->touch() method for updating the modified/created user. Accepted values are true (for current user) or any User object.
  • An alternative method for performing a www redirect via the .htaccess file in case the default one won't work (which may happen on some servers).

According to Ryan we're getting really close to a new stable release of ProcessWire. In fact it could be out as soon as in a few weeks, carrying version number 3.0.184. In the meantime we've still got some issues to resolve. If you'd like to help, grab the latest development version from GitHub and let us know if you run into any new issues.

That's all for our core updates section this week. Be sure to also check out the weekly update from Ryan at the support forum. Thanks!

Recipe of the week: making non-Page data selectable via a field

It's been a while since our last "recipe of the week" or "tips and tricks" post, but here's one focusing on a question that seems to pop up every once in a while: how does one make non-page content selectable via a field in the ProcessWire admin. There are a couple of easy solutions, both of which we'll cover briefly in this post.

The problem

When it comes to page content, it's very easy to make that selectable via a field: just create a page reference field, configure field settings, and it's done. But what if you wanted to select some piece of content that doesn't exist as a page, but rather just within your database, or perhaps even on the disk?

The solution

Depending on the data and your preferences there are a couple of easy solutions. Both involve third party modules: either relatively new contender Fieldtype Dynamic Options from Robin Sallis, or tried and true Fieldtype Select External Option from kixe.

These two modules allow you to make non-page content selectable, but other than that they are quite different: for Dynamic Options you'll populate the options via code, while Select External Option is a no-code solution that reads options directly from database. Here's a real world example — making Form Builder forms selectable via a field:

Key configuration settings for a "form" field that makes it possible to select items from the FormBuilder forms table. Option label will be the name of the form, while value is the ID.

That's all you need to get your form select field up and running with Select External Option. As for Dynamic Options, here's a code snippet that you could place — for an example — in your /site/init.php file to get more or less the same effect once you've created a Dynamic Options field called "form":

$wire->addHookAfter('FieldtypeDynamicOptions::getSelectableOptions', function(HookEvent $event) {
    $field = $event->arguments(1);
    if ($field->name === 'form') {
        $event->return = $event->forms->getFormNames();
    }
});

This is a rather limited example, of course, but the same approach can be applied to just about any data: if it's in the database you can easily make it selectable via Select External Option, otherwise (or if you just happen to prefer a programmatic approach) you can always use Dynamic Options. Both modules have their use cases.

That's all for our recipe of the week. Hope you found it useful, and please let us know if you've got suggestions for future recipes — or problems that need solving! — and we'd be happy to feature them in our future issues.

Site of the week: The Geffen Playhouse

Our latest site belongs to the Los Angeles based self-producing, not-for-profit theater company The Geffen Playhouse.

Founded in 1995, the Geffen welcomes more than 130.000 audience members every year. In addition to the theater work they also run a set of education and community engagement programs with the goal of involving underserved young people, as well as the community at large, in the arts.

The Geffen Playhouse website was crafted by Jonathan Lahijani and the team at Teak, and launched back in September 2019. The site was a part of a bigger project, which also involved a complete re-branding — including a custom font — done by Base.

The end result of the project is a beautiful website with a truly unique style that feels classic and modern at the same time. There's quite a bit of visual flair on the site, yet the overall user experience is rather straightforward and easy to grasp. Lots of content here as well: diverse pages introducing shows, gorgeous galleries, podcasts, blog, etc.

As for behind the scenes details, some of the key highlights include Uikit 3 for the front end, FullCalendar for various calendar views, a Repeater Matrix based content builder, and an integrations to the third party ticketing system AudienceView. For more details, check out the Geffen Playhouse showcase forum post from Jonathan Lahijani.

Thanks to Jonathan Lahijani for sharing this project with us, and our congratulations to the client, The Geffen Playhouse, for their splendid new website. Definitely a job well done from everyone involved in this project!

Stay tuned for our next issue

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