-
Notifications
You must be signed in to change notification settings - Fork 0
Description
As a project grows, the /site/templates/ directory becomes cluttered with dozens of PHP files (SSO handlers, AJAX controllers, admin-only views, etc.). Currently, organizing these into subfolders (e.g., /site/templates/sso/login.php) requires manually setting the "Alternate Template Filename" for each template.
However, the current implementation is restrictive:
- The field often strips the path or resets if the file doesn't exist at the exact moment of saving.
- There is no visual way to see or manage the folder structure within the Setup -> Templates list.
- Developers have to repeat the same path-entry process for every single file in a group.
Describe the solution you'd like
I would like to see "First-class citizen" support for subdirectories in the templates folder:
- Path persistence: Ensure the "Alternate Template Filename" field reliably accepts and saves relative paths like
folder/filename.phpwithout aggressive validation that might strip the directory prefix. - Template Groups/Folders in Admin: The ability to group templates in the Admin UI (Setup -> Templates) based on their physical folder location.
- Automatic discovery: An option to tell ProcessWire to look for a template file in a subdirectory by default if it's not found in the root (e.g., if a template is named
sso-login, PW could check for/sso/login.phpautomatically).
Describe alternatives you've considered
Currently, we use include or wireRenderFile inside a "bridge" file in the root, but this adds unnecessary file overhead and creates even more files in the root directory.
Additional context
As seen in the attached screenshot, managing 40+ files in a single flat list makes the development process prone to errors and hard to navigate.