About Connect Page Fields
Allows the connecting of two related Page fields so that changing one updates the other.
Admin helper modules are those that provide helpful tools, UI enhancements or optimizations to the admin panel (excluding Fieldtype or Inputfield modules).
Close to stable, but users are advised to be cautious and test thoroughly.*
|Date Added||November 7, 2016|
|Last Updated||May 17, 2018|
This module's files should be placed in /site/modules/ConnectPageFields/
How to install or uninstall modules
A module for ProcessWire CMS/CMF. Allows the connecting of two related Page fields so that changing one updates the other.
An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like...
- the 10 actors who have appeared in the most movies
- actors who haven't appeared in any movies since 1990
You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast").
The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling".
Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon".
Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates.
In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B.
You can add rows as needed using the "Add another row" button.
Make sure you have set the "Selectable Pages" settings for each Page field correctly:
- The settings for Page field A should allow pages using the template(s) that Page field B has been added to.
- The settings for Page field B should allow pages using the template(s) that Page field A has been added to.
Released under Mozilla Public License v2. See file LICENSE for details.
No comments yet. Be the first to post!
Your e-mail is kept confidential and not included with your comment. Website is optional.
- Admin Helpers
- Core Modules
- Development Tools
- Field Types
- File Validator
- Input Fields
- Language Modules
- Language Packs
- Markup Generation
- Premium Modules
- Process Modules
- Proof of Concept
- Site Profiles
- Social, Feeds, Services
- Text Formatters
- Other Modules
- Users and Access
*Use modules at your own risk. There are no guarantees or warranties. It is recommended that you backup your site and database before installing new modules.