1

With the latest Drupal 6 update, file_create_url() stopped working for all the files other than public or private files.

I think the assumption is that a file must be either in the public files or in the private files directory.

How can I get the image URL for those images that are in a theme or a module directory?

2

You don't need file_create_url() to turn those URIs into a URL to use in theme_image().

For theming images in Drupal 6, just supply a path string relative to base_path() (the base of the Drupal install directory). For module/themes this can path can be retrieved with drupal_get_path().

For example:

//Render an image under the admin_menu project
print theme('image', drupal_get_path('module','admin_menu').'images/bkg_tab.png'))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.