ProcessWire Weekly #385

In the 385th issue of ProcessWire Weekly we'll cover the latest weekly update from Ryan, check out a new fieldtype module called Page Reference Context Data, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly. In this issue we're going to talk a bit about some ongoing core updates introduced by Ryan in his latest weekly update, and also introduce a brand new third party module called Page Reference Context Data.

As our latest site of the week entry we've got the website of a Qatar mobile grocery app used to deliver fresh, clean, packed vegetables and fruits: the Harvest app. Stay tuned for more details.

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!

Weekly update from Ryan

Although there are no new commits in the GitHub repository this week, Ryan has some interesting plans to share in his latest weekly update at the support forum. Essentially he's been working on a core update, which is expected to improve code reusability and provide benefits in terms of performance:

I'm breaking down much of the logic (currently in the ProcessPageView module) into more focused parts that can become part of PW's $pages API, increasing reusability of related code. [...] At the same time, I'm looking for opportunities for optimization and performance improvement, and have already found a few.

— Ryan

Since this is a rather major update — even though it's not expected to cause any issues with existing hooks or anything along those lines — it's going to take a bit more time to prepare. According to Ryan we may see actual code updates by next week. We'll let you know when that happens.

That's all for our core updates section this week, but be sure to check out the weekly update forum thread for more details. Thanks!

New module: Page Reference Context Data

Page Reference Context Data is a new fieldtype module developed by Christoph Thelen, aka kixe. When used for a field, this module stores references to pages with additional data in field context. Context data is configured on a per field basis and made editable via page edit modal, provided by the Page Field Edit Links module.

Here's an example of how context data fields are defined in field settings:

text:InputfieldText,columnWidth=50,description=This is a description,label=Text,notes=Notes go here
integer:InputfieldInteger,columnWidth=50,inputType=number
area:InputfieldTextarea,rows=12
page:InputfieldPageListSelect,parent_id=1,inputfield=InputfieldAsmSelect

As for API usage, the gist of it is that you can access pages contained in the field the same way as with any regular Page Reference field, except that each page will have configured and saved context data available via underscore prefixed properties:

// call the field once to assign runtime values
$page->fieldname;

// iterate over stored pages, output the "text" context data field for each one
foreach ($page->fieldname as $item) {
    echo $item->_text;
}

If you'd like to give this module a try, you can clone or download it from the Fieldtype Page Context Data GitHub repository. Please note, though, that this module is still at alpha stage, so be sure to test carefully before installing it on a live site. Be sure to check out the module README file — there's a lot of useful information in there.

Big thanks to Christoph for sharing this project with us!

Site of the week: Harvest app

Our latest site of the week belongs to Harvest app — the first mobile application, available via Play Store for Android and App Store for iPhone, for shopping and getting fresh, clean, packed Vegetables and fruits delivered in Qatar.

The primary content of the Harvest app website is featured on the front page of the site: key app details along with call to action buttons for downloading the app. Design of the site is modern and fresh, with various views from the app itself, and a number of neat visual effects combined with very clean typography and interesting layout choices.

As for implementation details, it seems that the layout of this site might've been built using Webflow and then ported to ProcessWire. Either way, there's no full-blown front-end framework in use here, and no third party modules visible on the front-end of the site. JavaScript dependencies of the site include jQuery and the Slick slider plugin.

Our congratulations to the Harvest app for their new site, and thanks for sharing this project with us — looking really good!

Stay tuned for our next issue

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