Inconsistent handling of template files in subdirectories under theme directories
|Reported by:||eyelidlessness||Owned by:||westi|
If you place a template file in a subdirectory beneath a theme, the page editor detects these templates and they appear in the Template dropdown menu. The option value, however, does not include the subdirectory, and when saved, the page renders with the Default template (or presumably with a template of the same filename in the main theme directory, if present).
In file /path/to/theme/subdirectory/template-file.php /* Template Name: Foo */
Foo appears in Template dropdown menu in the page editor. Selecting Foo and saving is successful. Note that in the HTML of the editor page, the option value is simply "template-file.php", not "subdirectory/template-file.php".
The page in question renders with the default template, rather than the custom one.
Manually editing the entry in the database does result in the correct template file being loaded, so my suspicion is that this functionality is desired (it certainly is desired by me, for keeping files organized), but the value is not correctly being set.
Furthermore, editing the option value in the editor DOM to resolve to the correct path before saving results in the value not being saved at all.
Change History (26)
- Keywords has-patch added; template removed
- Milestone changed from Unassigned to 2.9