Development

Using the path_to_theme() function

When we build Drupal sites we typically have a lot of custom design elements. It is important to be able to display images from the filesystem in a dynamic fashion (non-absolute paths). Should you need to move the site, you wouldn’t want to have to reset image paths everywhere. The base_path() and path_to_theme() functions do all of the dirty work for you.

You may also want to check out the $directory variable that is part of the theme system in Drupal.

Leave a Reply

Your email address will not be published.