If /something/anotherthing is a node, the answer by cchen has you covered. In case it's not...
The base suggestions are built up in theme_get_suggestions
, (called by template_preprocess_html
), and mirror the path and its parents. So for a path of /foo/bar/baz, you'll automatically have:
- html
- html__foo
- html__foo__bar
- html__foo__bar__baz
You can approach changing that in a couple of different ways:
Don't use the built-in suggestions, create your own:
function MYMODULE_preprocess_html(&$vars) {
// Example only, if you have a better way to determine the path, use it!
if (request_uri() == '/something/anotherthing') {
$vars['theme_hook_suggestions'] = 'something__anotherthing';
}
}
A template file named something--anotherthing.tpl.php
would be picked up for that path only.
Remove the built-in suggestion for the parent when visiting the child:
function MYMODULE_preprocess_html(&$vars) {
if (request_uri() == '/something/anotherthing/details') {
$index = array_search('html__something__anotherthing', $vars['theme_hook_suggestions']);
if ($index !== FALSE) {
unset($vars['theme_hook_suggestions'][$index]);
}
}
}
This method is probably best as an example only, as you'll have to remember to add more exceptions to the code as you add new pages under /something/anotherthing.
Both examples can also be implemented in a theme if that's preferable.