In the directory containing a custom module, I have a directory containing images.
How do I get the URL of those images?
drupal_get_path('module', $module_name);
The easiest way, like referred above, is to use the relative path to site root:
'/' . drupal_get_path('module', $module_name) . '/img1.jpg'
Using it without the trailing slash in the beginning would break it on multiple level aliases, e.g. http://www.your_site.dev/category/2012/11/02/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With