Search code examples
phptemplatesdrupal

Naming Drupal 7 template files based on url


If I have a page whose url alias is "/api/user/create", how can I name a template file based on the url such as "page-api-user-create.tpl.php".


Solution

  • You need to name it:

    page--api--user--create.tpl.php
    

    (note double dashes in the file name).

    See http://drupal.org/node/1089656 for more info.