Inside page.tpl.php, I would like to refer to images stored as part of my template. Therefore, I would like to use something like this:

$path_to_image = $path_to_theme . '/img/imagename.gif'; // $path_to_theme should be something like 'themes/mythemename'

How do I get the theme path without hardcoding?

Thanks a lot,
Dennis

Comments

shrop’s picture

Look at the directory variable in the Drupal Handbook at:

http://drupal.org/node/11812

Thanks,
Mark

heine’s picture

The phptemplate variable with the theme directory is $directory. (This is filled in phptemplate.engine with a call to .... path_to_theme() )
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

davosian’s picture

Thanks for your help, guys!