Hierarchical Page Template Redirect

Assigns hierarchical templates to pages and their children giving precedence to the page-[id].php templates.

Author:Loren Warkentin (profile at wordpress.org)
WordPress version required:2.8
WordPress version tested:3.3.2
Plugin version:0.1
Added to WordPress repository:20-07-2011
Last updated:05-06-2012
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:60
Rated by:2
Plugin URI:http://www.warkensoft.net/wordpress-plugins/w...
Total downloads:2 080
Active installs:20+
plugin download
Click to start download

In WordPress each page must be intentionally assigned a template (or have a template file intentionally named for it) or WordPress applies the default page.php template. Child pages do not inherit parent page templates. On a large website with many child pages within a hierarchy of pages this does not make for an easy or error free way to use page templates to create a sectioned CMS. A user can assign a template to a top level page (or a "beginning of section" page) but its descendants (child pages) will not follow with their ancestor's template. Each page's template must be individually assigned. For small sites with few pages and few users this is not a significant matter. On a site with hundreds or thousands of pages and multiple editors and multiple "sections" this makes WordPress less than ideal as a CMS platform

This plugin solves that problem. It investigates each page and assigns hierarchical templates to pages and their children giving precedence to page-[id].php templates. If no page-[id].php templates are found all the way up the ancestory tree then it will check for page-[slug].php templates back up the ancestory tree. If those are not found then it will look for a meta assigned custom.php template - first for the currently selected page and then if the page does not have a custom.php template assigned the function will look back up the ancestory tree to see if an ancestor page has been assigned a custom.php template. If all of these fail it will fall back to WP's default page.php template.

There is more description at http://www.warkensoft.net/wordpress-plugins/wordpress-hierarchical-page-template-redirect-plugin/