About Create a Pages->find(query) as a field

This module allows you to defined a Pages selector query ($pages>find()) as a field and attach it to a template. The results of the query (PageArray) are accessed like any other page field, $page->myQuery

Category 1Field Types
Fieldtype modules that represent a data type used by fields.
Category 2Input Fields
Inputfield modules that provide a UI input widget in the ProcessWire admin.
Release StateBeta
Close to stable, but users are advised to be cautious and test thoroughly.*
Module Version1.0.1
Class NameFieldtypePagesSelectorQuery
Compatibility2.3, 2.4
Date AddedJuly 22, 2013
Recommended ByNew recommendations may take up to 1 day to appear.


I was trying to solve the problem of running a query as a field, and this is the result.

I started with Hanna text, but that didn't quite get me all the way. Then I tried just a Concat field, and that didn't get me all the way.

I modified the Concat fieldtype for my solution. I had a need to dynamically pull Pages that were cross-referenced back:
Product as a Page
Photo Pages with a multi-Page Select field that referenced Product (A photo could represent 1+ Products)

I wanted a ->photos field from Product that was updated dynamically according to what Photo entries were currently in place, and I didn't want copy/pasted code, and I wanted the selectors to be easily modifiable from the admin screens.


Usage is faily simple:

1: Install as a normal module

2: Create a field as a PagesSelectorQuery type

3: On the field details, enter your selector string, ie: template=my_template,select_page_field=$page

4: Add your field to whichever templates.

5: Access the PageArray results like you would any other $page->field