Search code examples
drupaldrupal-6drupal-theming

Drupal page.tpl.php template for dynamic URL's


I read about the basic path/template naming in Drupal, but I couldn't figure out how to handle dynamic URLs.

Say, I have a page on : www.example.com/company/companyname/news - and company name is dynamic. Is there a way that I can create a template page for this, such as page-company-*-news.tpl.php? (which, of course, is an illegal file name). This field, "company name" could also contain hyphens ("-").

I am running Drupal 6, and paths are created with Pathauto.

Thank you, Michael


Solution

  • Add custom template suggestions in a preprocess function. See Working with template suggestions for details.