Introduce dynamic Parent specification in the Page Reference field to allow project-specific value list creation and maintenance.
Optional: Steps that explain the enhancement
Modify the Page Reference field settings to allow dynamic specification of Parent pages.
Provide an option in the field settings to define conditions or rules for dynamic parent specification.
Implement the functionality where the specified conditions or rules determine the set of available parent pages dynamically based on the project context.
Current vs. suggested behavior
Current Behavior: The Page Reference field allows users to create and maintain global value lists that are applicable across all projects in a system.
Suggested Behavior: The Page Reference field would offer an option to specify Parent pages dynamically, enabling users to create and maintain project-specific value lists. This would be particularly helpful for systems with multiple unique projects.
Why would the enhancement be useful to users?
Reduces the need for redundant global value lists and allows for more precise and contextual data management.
Data Integrity: Dynamic specification minimizes the chance of mistakenly linking to irrelevant data or parent pages, ensuring better data accuracy and integrity.
Use cases:
Project Management Systems: For organizations that handle a diverse set of projects, each project might have its own unique set of tasks, milestones, or contacts. Dynamic parent specification allows each project to maintain its own set of references without cluttering global lists.
Learning Management Systems (LMS): Course creators can design curriculum paths that are tailored to specific courses or student demographics, showing contextually relevant materials or quizzes.
CRM (Customer Relationship Management) Systems: For businesses managing various clients across different industries, this feature can present industry-specific contacts, deals, or communications dynamically.
Human Resource Platforms: HR professionals can view employee details, benefits, or training modules dynamically based on department, role, or seniority.
Travel Booking Portals: Based on the chosen destination, travelers can get dynamic lists of available activities, accommodations, or local guidelines.
Optional: Screenshots/Links that demonstrate the enhancement
Workaround using ready.php
Service info to those looking for a solution right now: Use this snippet:
$wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) {
// Field Project Milestone is used on Project Task Templates. Populate the Milestone field on the current Project Task with milestones for the current project.
// field: project_milestone
if($event->object->hasField == 'project_milestone') {
$items = new PageArray;
if( $event->arguments('page')->template == 'project' ) {
$milestones = $event->arguments('page')->children('template=project_milestones,sort=sort');
foreach($milestones as $milestone) {
if( $milestone->parent == $event->arguments('page') ) {
$items->add($milestone);
}
}
} else if( $event->arguments('page')->template == 'project-task' ) {
$milestones = $event->arguments('page')->parent->children('template=project_milestones,sort=sort');
foreach($milestones as $milestone) {
if( $milestone->parent == $event->arguments('page')->parent ) {
$items->add($milestone);
}
}
} else if( $event->arguments('page')->template == 'jtbd-step-need' ) {
$milestones = $event->arguments('page')->parent->parent->children('template=project_milestones,sort=sort');
foreach($milestones as $milestone) {
if( $milestone->parent == $event->arguments('page')->parent->parent ) {
$items->add($milestone);
}
}
}
$event->return = $items;
}
});
Short description of the enhancement
Introduce dynamic Parent specification in the Page Reference field to allow project-specific value list creation and maintenance.
Optional: Steps that explain the enhancement
Current vs. suggested behavior
Current Behavior: The Page Reference field allows users to create and maintain global value lists that are applicable across all projects in a system.
Suggested Behavior: The Page Reference field would offer an option to specify Parent pages dynamically, enabling users to create and maintain project-specific value lists. This would be particularly helpful for systems with multiple unique projects.
Why would the enhancement be useful to users?
Use cases:
Optional: Screenshots/Links that demonstrate the enhancement
Workaround using ready.php
Service info to those looking for a solution right now: Use this snippet: