page-custom_page_name.tpl.php 页面 - 自定义 - 页面 - name.tpl.php 等等。
Is there a simple way to create a custom template in a theme for a custom page in Drupal 7.
I've tried all of the normal conventions:
page-custom_page_name.tpl.php page-custom--page--name.tpl.php etc.
None seem to be working. Help would be much appreciated!
Drupal automatically provides path based overrides; so if the path to your custom page is, say, 'custom/page/path' you can create a template file called 'page--custom--page--path.tpl.php`, which will only be used for that page.
Remember to clear Drupal's caches each time you add a new template file or the theme registry won't pick it up.
Using the alias or 'custom/page/path' as suggested didn't work for me.
According to the Drupal documentation:
The internal/path is not the alias it's the node's ID.
...the Drupal path is not any of its aliases: there is one and only one Drupal path for a page. For the examples "http:// www.example.com/node/1/edit" and "http:// www.example.com/mysitename?q=node/1/edit", the Drupal path is node/1/edit, and its components are "node", 1, and "edit".
So in my case a basic page would be custom themed by page--node--1234.tpl.php where 1234 is the node id.