[wp-trac] [WordPress Trac] #10959: Inconsistent handling of template files in subdirectories under theme directories
WordPress Trac
wp-trac at lists.automattic.com
Thu Oct 15 01:09:54 UTC 2009
#10959: Inconsistent handling of template files in subdirectories under theme
directories
----------------------------+-----------------------------------------------
Reporter: eyelidlessness | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Unassigned
Component: Template | Version: 2.8.4
Severity: normal | Keywords: template subdirectory
----------------------------+-----------------------------------------------
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).
Example:
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10959>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list