1

Pathauto changed where drupal_get_path looks for an image path I'm calling.

<img src="<?php print drupal_get_path('theme', 'maafs_subpage'); ?>/images/iafe.jpg" alt="Iafe the Network">

This was accessing http://localhost/maafs/sites/all/themes/maafs_subpage/images/iafe.jpg

Now it's trying to access http://localhost/maafs/news/sites/all/themes/maafs_subpage/images/iafe.jpg

Is there a work around for this or is there a better way of getting the path for the image?

Thanks in advance for your help.

1 Answer 1

0

Are you accessing this link from a subpage? It would seem that it is not appropriately pulling from the Drupal root when you are making the call (from a page other than the homepage).

You can use the global variable $base_path to get the Drupal root. More information on this global variable: https://api.drupal.org/api/drupal/developer%21globals.php/global/base_path/7

1
  • Glad you got it working! Commented Mar 12, 2015 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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